This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Error building SYS/BIOS Hello example

Other Parts Discussed in Thread: AM3359, SYSBIOS

Hi,

I followed the "Getting Started" guide and created Hello World example for AM3359 chip. But I received the following error on first build:

**** Build of configuration Debug for project hello_AM3359_CortexA ****

"C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
'Building file: ../hello.cfg'
'Invoking: XDCtools'
"C:/TI/xdctools_3_25_02_70/xs" --xdcpath="C:/TI/bios_6_35_03_47/packages;C:/ti/ccsv5/ccs_base;" xdc.tools.configuro -o configPkg -t gnu.targets.arm.A8F -p ti.platforms.beaglebone -r release -c "C:/ti/ccsv5/tools/compiler/gcc-arm-none-eabi-4_7-2012q4" "../hello.cfg"
making package.mak (because of package.bld) ...
generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
configuring hello.xa8fg from package/cfg/hello_pa8fg.cfg ...
generating custom ti.sysbios library makefile ...
Starting build of library sources ...
making C:/TI/workspace_v5_4/hello_AM3359_CortexA/src/sysbios.aa8fg ...
asma8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/IntrinsicsSupport_asm_gnu.asm ...
asma8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/TaskSupport_asm_gnu.asm ...
asma8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/exc/Exception_asm_gnu.asm ...
asma8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/a8/TimestampProvider_asm_gnu.sv7A ...
asma8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/a8/Mmu_asm_gnu.sv7A ...
asma8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/a8/Cache_asm_gnu.sv7A ...
asma8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/a8/intcps/Hwi_asm_gnu.sv7A ...
asma8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/timers/gptimer/Timer_asm_gnu.sv7A ...
asma8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/timers/dmtimer/Timer_asm_gnu.sv7A ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/BIOS.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/IntrinsicsSupport.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/TaskSupport.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/hal/Hwi.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/hal/Hwi_stack.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/hal/Hwi_startup.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/hal/Timer.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/hal/Cache.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/knl/Clock.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/knl/Idle.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/knl/Intrinsics.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/knl/Queue.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/knl/Semaphore.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/knl/Swi.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/knl/Swi_andn.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/knl/Task.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/a8/Cache.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/a8/Mmu.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/a8/TimestampProvider.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/heaps/HeapMem.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/gates/GateHwi.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/gates/GateMutex.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/a8/intcps/Hwi.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/exc/Exception.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/rts/gnu/ReentSupport.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/timers/dmtimer/Timer.c ...
cla8fg C:/TI/bios_6_35_03_47/packages/ti/sysbios/family/arm/a8/ti81xx/TimerSupport.c ...
ara8fg arm_IntrinsicsSupport_asm_gnu.o arm_TaskSupport_asm_gnu.o exc_Exception_asm_gnu.o a8_TimestampProvider_asm_gnu.o a8_Mmu_asm_gnu.o a8_Cache_asm_gnu.o intcps_Hwi_asm_gnu.o gptimer_Timer_asm_gnu.o dmtimer_Timer_asm_gnu.o _BIOS.o arm_IntrinsicsSupport.o arm_TaskSupport.o hal_Hwi.o hal_Hwi_stack.o hal_Hwi_startup.o hal_Timer.o hal_Cache.o knl_Clock.o knl_Idle.o knl_Intrinsics.o knl_Queue.o knl_Semaphore.o knl_Swi.o knl_Swi_andn.o knl_Task.o a8_Cache.o a8_Mmu.o a8_TimestampProvider.o heaps_HeapMem.o gates_GateHwi.o gates_GateMutex.o intcps_Hwi.o exc_Exception.o gnu_ReentSupport.o dmtimer_Timer.o ti81xx_TimerSupport.o ...
Build of libraries done.
cla8fg package/cfg/hello_pa8fg.c ...
'Finished building: ../hello.cfg'
' '
        1 file(s) copied.
making ../src/sysbios.aa8fg ...
gmake[1]: Nothing to be done for `all'.
'Building file: ../hello.c'
'Invoking: GNU Compiler'
"C:/ti/ccsv5/tools/compiler/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard -Dam3359 -I"C:/ti/ccsv5/tools/compiler/gcc-arm-none-eabi-4_7-2012q4/arm-none-eabi/include" -g -gstrict-dwarf -Wall -MMD -MP -MF"hello.d" -MT"hello.d" -o"hello.o" @"./configPkg/compiler.opt"  "../hello.c"
'Finished building: ../hello.c'
' '
'Building target: hello_AM3359_CortexA.out'
'Invoking: GNU Linker'
"C:/ti/ccsv5/tools/compiler/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc.exe" -mfloat-abi=hard -Dam3359 -g -gstrict-dwarf -Wall -Wl,-Map,"hello_AM3359_CortexA.map" -nostartfiles -static -Wl,--gc-sections -L"C:/TI/xdctools_3_25_02_70/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu" -Wl,--defsym,STACKSIZE=0x10000 -Wl,--defsym,HEAPSIZE=0x400 -o"hello_AM3359_CortexA.out" "./hello.o" -Wl,--start-group -l"c" -l"gcc" -l"m" -l"nosys" -Wl,--end-group -Wl,-T"./configPkg/linker.cmd"  
C:\TI\workspace_v5_4\hello_AM3359_CortexA\Debug\configPkg\package\cfg\hello_pa8fg.oa8fg: In function `xdc_runtime_SysMin_output(int0_t)':
C:\TI\workspace_v5_4\hello_AM3359_CortexA\Debug\configPkg/package/cfg/hello_pa8fg.c:2326: undefined reference to `_write'
C:/TI/xdctools_3_25_02_70/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu\libg.a(lib_a-signalr.o): In function `_kill_r':
/db/ztree/library/trees/gnu/gnu-b09x/src/linaro/gcc-arm-none-eabi-4_7-2012q4-20121208/src/newlib/newlib/libc/reent/signalr.c:61: undefined reference to `_kill'
C:/TI/xdctools_3_25_02_70/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu\libg.a(lib_a-signalr.o): In function `_getpid_r':
/db/ztree/library/trees/gnu/gnu-b09x/src/linaro/gcc-arm-none-eabi-4_7-2012q4-20121208/src/newlib/newlib/libc/reent/signalr.c:96: undefined reference to `_getpid'
collect2.exe: error: ld returned 1 exit status
gmake: *** [hello_AM3359_CortexA.out] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****

What's wrong and how do I fix it?

Regards,
Vasili

  • Hi Vasili,

    XDC tools used to include a system call stub library for GNU A8 targets prior to XDC 3_25_02_65. With 3_25_02_65, XDC tools has stopped shipping this library. The application now needs to be linked with librdimon/libnosys (depending on whether semi-hosting support is enabled or not).

    Please refer this SYS/BIOS FAQ topic for more info on this:

    http://processors.wiki.ti.com/index.php/SYS/BIOS_FAQs#15_Build_options_and_C_runtime_library_re-entrancy_for_Cortex-A_GNU_targets

    GNU A8 targets also differ from TI A8 targets in the way they handle standard IO. For CIO to work on GNU A8 targets, semi-hosting needs to be enabled. Please refer this SYS/BIOS FAQ for more info on how to enable semi-hosting for a SYS/BIOS app:

    http://processors.wiki.ti.com/index.php/SYS/BIOS_FAQs#14_Enabling_Semi-Hosting_for_Cortex-A_GNU_targets

    Best,

    Ashish

  • Hi Ashish,

    1. As you can see from the error listing I provided, the default example generated is already linked with libnosys. So why doesn't it work?

    2. What is Semi-hosting?

    Best,
    Vasili

  • Hi Vasili,

    I believe what you are seeing is a known linker option ordering problem in CCS v5.4. The issue is that the link ordering for libraries relative to linker.cmd file in CCS GNU projects is incorrect. This should be fixed in CCS v5.5. As a workaround to fix the problem, can you try the following:

    Step1: Open build settings and delete the libraries from the Libraries section.

    Step2: Manually add the libraries at the end of the link line.

    ARM gives a good overview of what semi-hosting is in their documentation. Please check out this link: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjjgij.html

    Best,

    Ashish

  • Hi,

    Indeed, this solved the problem.

    Thanks!

  • I'm having this issue in CCS 5.5 (using g++.exe), even after re-ordering the libraries. Are there any other workarounds?

  • Hi Tim,

    The workaround shared in this thread is for CCS v5.4 only. The examples should work out of the box on CCS v5.5. Can you share the error log you are getting ?

    Thanks,

    Ashish

  • Here's the error:

    c:/ccs5_5/ccsv5/tools/compiler/gcc-arm-none-eabi-4_7-2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/fpu\libc.a(lib_a-signalr.o): In function `_kill_r':signalr.c:(.text._kill_r+0x1c): undefined reference to `_kill'


    g++.exe reports this version:


    g++ (GNU Tools for ARM Embedded Processors) 4.7.3 20121207 (release) [ARM/embedded-4_7-branch revision 194305] Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    And strangely, objdump reports that kill is in the same library from where it's called:

    +>objdump -t libc.a | findstr kill
    00000000         *UND*  00000000 _kill_r
    00000000 l    d  .text._kill_r  00000000 .text._kill_r
    00000000 l       .text._kill_r  00000000 $a
    0000003c l       .text._kill_r  00000000 $d
    00000000 g     F .text._kill_r  00000040 _kill_r
    00000000         *UND*  00000000 _kill
    lib_a-syskill.o:     file format elf32-little
    00000000 l    df *ABS*  00000000 syskill.c
    00000000 l    d  .text.kill     00000000 .text.kill
    00000000 l       .text.kill     00000000 $a
    00000024 l       .text.kill     00000000 $d
    00000000 g     F .text.kill     00000028 kill
    00000000         *UND*  00000000 _kill_r

    RE: Error building SYS/BIOS Hello example

  • Tim,

    Which bsp library are you linking with (rdimon or nosys) ? Can you also share the linker options when you build your project ? The linker opts should be printed on the CCS console.

    While looking at the error msg you shared, I also realized that you are linking with the C runtime library shipped with the gnu tools and not the libraries shipped with SYS/BIOS. This is not the reason for the linker error you are seeing but is important if you need the C runtime functions to be re-entrant. SYS/BIOS rebuilds the C runtime library (with re-entrancy support enabled) and ships it. Please see the last para of this FAQ for more info on how to link with our version of the C runtime libraries.

    Best,

    Ashish

  • Ashish,


    Here's my full linker command line. Changing rdimon to nosys didn't help.

    "C:/CCS5_5/ccsv5/tools/compiler/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-g++.exe" -Wl,-Map,"..\..\..\..\..\exe\a15_memtest.map" -o"..\..\..\..\..\exe\a15_memtest.elf" CMakeFiles/a15_memtest.dir/__/common/micro5g_devboard_init.o CMakeFiles/a15_memtest.dir/__/boot/bootload.o  ..\..\..\..\..\lib\libm5gige_firmware_hal_tda2xx_ism5g   -mfloat-abi=hard -Dfar -Dgcc -D__DYNAMIC_REENT__ -D_INCLUDE_NIMU_CODE -D_INCLUDE_IPv6_CODE -D_NDK_EXTERN_CONFIG -ffunction-sections -fdata-sections -gstrict-dwarf -Wall -nostartfiles -static  -Wl,-T"C:\Code\br\tools\build\\..\..\bin\SYSBios-elf-a15-m5gige-debug\generated/linker.cmd" -Wl,-Os -Wl,--gc-sections -Wl,-start -lgcc -lc -lm -lrdimon -Wl,-end"C:/CCS5_5/ccsv5/tools/compiler/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-g++.exe" -Wl,-Map,"..\..\..\..\..\exe\a15_bootwriter.map" -o"..\..\..\..\..\exe\a15_bootwriter.elf" CMakeFiles/a15_bootwriter.dir/vayu_init.o CMakeFiles/a15_bootwriter.dir/nandDma.o CMakeFiles/a15_bootwriter.dir/vayu_bootburn.o  ..\..\..\..\..\lib\libm5gige_firmware_hal_tda2xx_starterware ..\..\..\..\..\lib\libm5gige_firmware_hal_tda2xx_ism5g   -mfloat-abi=hard -Dfar -Dgcc -D__DYNAMIC_REENT__ -D_INCLUDE_NIMU_CODE -D_INCLUDE_IPv6_CODE -D_NDK_EXTERN_CONFIG -ffunction-sections -fdata-sections -gstrict-dwarf -Wall -nostartfiles -static  -Wl,-T"C:\Code\br\tools\build\\..\..\bin\SYSBios-elf-a15-m5gige-debug\generated/linker.cmd" -Wl,-start -lgcc -lc -lm -lrdimon -Wl,-end

    Tim

  • Hi Tim,

    You are still linking with the C runtime libs shipped with the compiler tools instead of the C runtime we ship with SYS/BIOS (TI-RTOS). Can you add the following to your linker opts to force our libs to get used:

    "-L$(SYSBIOS)/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu" (for SYS/BIOS 6.40+)
    or
    
    "-L$(XDCTOOLS)/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu" (for earlier releases)

    where $(SYSBIOS) and $(XDCTOOLS) are the installation paths of the respective products.

    Best,

    Ashish