+ Reply to Thread
Results 1 to 2 of 2

Thread: XMC1300 GNU GCC Linker HELP

  1. #1
    New Member New Member mbush91 is on a distinguished road
    Join Date
    Nov 2018

    XMC1300 GNU GCC Linker HELP

    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!

  2. #2
    Beginner Beginner andrew is on a distinguished road
    Join Date
    May 2018
    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]
    Also make sure to include syscalls.c available from the 'ThirdPartyLibraries' folder of your XMCLib
    Last edited by andrew; Nov 19th, 2018 at 01:43 AM.

+ Reply to Thread

Tags for this Thread


All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.

Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.