XMC1300 GNU GCC Linker HELP

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User16076
Level 1
Level 1
Been stuggling with the for 2 days not. Trying to use the GNU GCC compiler with the XMCLibs sdk. I am using the GCC startup_XMC1300.S along with the XMC1300x0032.ld

using the following gcc command

arm-none-eabi-gcc -g -Wall -O0 --specs=nano.specs -mthumb -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -mcpu=cortex-m0 -o prog.out -T XMC1300x0032.ld -DUC_FAMILY=XMC1 -DXMC1302_T016x0032 -DPROD [-I INCLUDE FILES] [SOURCE FILES] startup_XMC1300.S


with that I keep receiving


(.text+0x68): undefined reference to `__bss_start__'
(.text+0x6c): undefined reference to `__bss_end__'


I can use -nostartfiles to get rid of it but then I get

init.c:(.text.__libc_init_array+0x12): undefined reference to `_init'


Please help! I have been googling for hours!
0 Likes
1 Reply
User15087
Level 2
Level 2
First like received
I think you should first compile your .S file, for example:

arm-none-eabi-gcc -mthumb -mcpu=cortex-m0 -MD -I. -I./Libraries/CMSIS/Include -I./Libraries/CMSIS/Infineon/XMC1400_series/Include -I./Libraries/XMCLib/inc -o build/startup_XMC1400.o -c ./Startup/startup_XMC1400.S



Afterwards, the following linker command should work:
arm-none-eabi-gcc -T linker_script.ld -nostartfiles -Xlinker --gc-sections -specs=nano.specs -specs=nosys.specs -mcpu=cortex-m0 -mthumb -o build/main.elf [OBJECT FILES]


[edit]
Also make sure to include syscalls.c available from the 'ThirdPartyLibraries' folder of your XMCLib
0 Likes