Skip to main content
MBeau.1
Associate
Solved

Custom linker won't compile

I'm trying to reserve space in RAM for emulated eeprom. I can read and write fine, however when I try to modify the linker it won't compile.

The added user section

/* Specify the memory areas */
MEMORY
{
 FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 96K
 USER_DATA (rwx) : ORIGIN = ORIGIN(FLASH) + LENGTH(FLASH)‬‬, LENGTH = 32K
 RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
 MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
}

Howerver when trying to compile it says «invalid character» at the line of the new section in the linker script:

c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe:../stm32_flash.ld:48: ignoring invalid character `\342' in expression

c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe:../stm32_flash.ld:48: ignoring invalid character `\200' in expression

attempt to open c:/st/stm32cubeide_1.3.0/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v7-m\libm.a failed

c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe:../stm32_flash.ld:48: ignoring invalid character `\254' in expression

c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe:../stm32_flash.ld:48: ignoring invalid character `\342' in expression

c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm-none-eabi\bin\ld.exe:../stm32_flash.ld:48: ignoring invalid character `\200' in expression

This topic has been closed for replies.
TDK
TDKBest answer

You have unicode characters in your script which should be strictly ASCII.

Delete the line it's complaining about and retype it on the keyboard. Don't copy/paste.

"If you feel a post has answered your question, please click ""Accept as Solution""."

3 replies

TDK
TDKBest answer

You have unicode characters in your script which should be strictly ASCII.

Delete the line it's complaining about and retype it on the keyboard. Don't copy/paste.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Tesla DeLorean
Guru

Pasting via generic Notepad app can strip formatting.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
MBeau.1
MBeau.1Author
Associate

It did the trick, I used a different editor as well.