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.

CCS/AM6548: Linker start address value

Part Number: AM6548

Tool/software: Code Composer Studio

 (instructions 9.9.2 step 8, processor SDK RTOS 06.00.00.07)

Trying to run simple hello-WORLD program on AM6548 EVM  and having a issue related to running the program on the A53_0 core.

When the program is loaded there is no Hello World output and at pausing the program counter is not in the main function despite having the infinite loop.

The thought is the program is not actually executing the main function because (probably) of an incorrect start address.

Step 8:Navigate to Project Properties -> CCS Build -> GNU Linker and add “Entry” to the “Set start address” field.

When following step 8 the start address "Entry" throws a build error

When modify tho "entry" or "main" we see the previous mentioned problem.

Is this thought  correct and if so what is the correct stating address?

  • Florin,

    Can you confirm that you are following the steps described in :

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_examples_demos.html#no-os-bare-metal-example

    There was a known issue with GCC 64 bit compiler and CCS where the symbols in application were not being detected that is listed in the Release notes:

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_release_specific.html#fixed-issues (Check PRSDK-4654)

    Full details of the resolution:

    The issue is caused as the debug symbols in the output binary are corrupted when .note.gnu.build-id section in linker command file is marked NOLOAD.  

    NOLOAD is usually used in the context of setting up a heap or stack in an embedded system, or identifying a ROM that is already present on the system.
    .note.gnu.build-id (NOLOAD) :

    Note:
    Usage of .note.gnu.build-id section is to store the build-id which is mainly used in case of separate debug information file from main executable and debugger uses this build-id to cross-check the debug information as described here[1]. If this is case for you then solution would be to remove NOLOAD from .note.gnu.build-id section as follows:
    .note.gnu.build-id : { *(.note.*) }

    Or else if you use single .elf file with debug information to be loaded in your debugger then I think .note.gnu.build-id section is redundant and you could simply discard it in linker script as follows:
    /DISCARD/ :

    { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) *(.note.gnu.build-id) }


    An alternative to do this is to enable Wl,-build-id=none GCC flag to disable creation of .note.gnu.build-id ELF note section.
    [1] https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html

     Reference example with the fix:

    To test the resolution please use the A53 bare-metal template app that we have included here:

    processor_sdk_rtos_am65xx_x_xx_xx_xx\demos\rtos_template_app

    There is a bare-metal and a TI RTOS template included which contains the linker_a53.lds file with this fix. We provide a pre-created CCS project that you should just be able to import and build in CCS workspace to check the fix.

    Documentation on Template app: http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_examples_demos.html

    Hope this helps

    Regards,

    Rahul

  • Hi Rahul,

    Yes, we are following the steps in http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_examples_demos.html#no-os-bare-metal-example.

    Here is my GNU Linker Libraries config:

    I'll outline the different issues we're seeing below.


    1. When we follow them exactly and Navigate to Project Properties -> CCS Build -> GNU Linker and add “Entry” to the “Set start address” field, we receive the following build error:

    C:\\ti\\ccs901\\ccs\\utils\\bin\\gmake" -k -j 4 all -O
     
    Building file: "../main.c"
    Invoking: GNU Compiler
    "C:/ti/ccs901/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a53 -mtune=cortex-a53 -fno-exceptions -Dam6548 -Dcore0 -DAARCH64 -DSOC_AM6X -I"C:/Users/a0225868/workspace_v9/Hello_World" -I"C:/ti/ccs901/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"main.d" -MT"main.o"   -o"main.o" "../main.c"
    Finished building: "../main.c"
     
    Building target: "Hello_World.out"
    Invoking: GNU Linker
    "C:/ti/ccs901/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc.exe" -mtune=cortex-a53 -fno-exceptions -Dam6548 -Dcore0 -DAARCH64 -DSOC_AM6X -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -mcpu=cortex-a53 -Wl,-Map,"Hello_World.map" --entry Entry -L"C:/ti/pdk_am65xx_1_0_5/packages/ti/csl/lib/am65xx/a53/release" -Wl,--defsym,CORE0=1 -Wl,--defsym,STACKSIZE=0x10000 -Wl,--defsym,HEAPSIZE=0x400 -o"Hello_World.out" "./main.o" -Wl,-T"../linker_a53.lds"  -Wl,--start-group -l:ti.csl.init.aa53fg -l:ti.csl.aa53fg -lrdimon -lstdc++ -lgcc -lc -lm -Wl,--end-group
    makefile:149: recipe for target 'Hello_World.out' failed
    C:/ti/pdk_am65xx_1_0_5/packages/ti/csl/lib/am65xx/a53/release/ti.csl.init.aa53fg: error adding symbols: File format not recognized
    collect2.exe: error: ld returned 1 exit status
    gmake[1]: *** [Hello_World.out] Error 1
    makefile:145: recipe for target 'all' failed
    gmake: *** [all] Error 2

    **** Build Finished ****

    2. When we build with any other entry point("main" or "entry" or nothing in the text box) the program gets stuck at address 0x0000000000000200, while the main function is stored at 0x00000000700010C4(I tried setting the start point at this address as well with no luck).

    3. When I follow the suggestion of copying the C:\ti\processor_sdk_rtos_am65xx_6_00_00_07\demos\rtos_template_app\am65xx\evmAM65xx\A53\template_app\linker_a53.lds, I receive the following error during build time:


    **** Build of configuration Debug for project Hello_World ****

    "C:\\ti\\ccs901\\ccs\\utils\\bin\\gmake" -k -j 4 all -O
     
    Building file: "../main.c"
    Invoking: GNU Compiler
    "C:/ti/ccs901/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a53 -mtune=cortex-a53 -fno-exceptions -Dam6548 -Dcore0 -DAARCH64 -DSOC_AM6X -I"C:/Users/a0225868/workspace_v9/Hello_World" -I"C:/ti/ccs901/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"main.d" -MT"main.o"   -o"main.o" "../main.c"
    Finished building: "../main.c"
     
    Building target: "Hello_World.out"
    Invoking: GNU Linker
    "C:/ti/ccs901/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc.exe" -mtune=cortex-a53 -fno-exceptions -Dam6548 -Dcore0 -DAARCH64 -DSOC_AM6X -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -mcpu=cortex-a53 -Wl,-Map,"Hello_World.map" --entry 0x0000000070000ffc -L"C:/ti/pdk_am65xx_1_0_5/packages/ti/csl/lib/am65xx/a53/release" -Wl,--defsym,CORE0=1 -Wl,--defsym,STACKSIZE=0x10000 -Wl,--defsym,HEAPSIZE=0x400 -o"Hello_World.out" "./main.o" -Wl,-T"../linker_a53.lds"  -Wl,--start-group -l:ti.csl.init.aa53fg -l:ti.csl.aa53fg -lrdimon -lstdc++ -lgcc -lc -lm -Wl,--end-group
    makefile:149: recipe for target 'Hello_World.out' failed
    c:/ti/ccs901/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: cannot find ti.board.aa53fg
    collect2.exe: error: ld returned 1 exit status
    gmake[1]: *** [Hello_World.out] Error 1
    makefile:145: recipe for target 'all' failed
    gmake: *** [all] Error 2

    I'd also like to note that the pre-made project that should compile out of the box(baremetal_template_app_am65xx_a53_evmAM65xx) fails to build as well.

    What steps do you recommend we take to overcome these issues and successfully run a hello_world program?

    Thanks,
    Barend

  • Barend,

    CCSv9.0 does not ship with GCC compiler for 64 bit ARM processors. You seem to be using 32 bit version of GCC compiler which is meant for Cortex A15, A9 and A8 platforms. 

    Please make sure that 64 bit compiler included in Processor SDK RTOS is detected in your CCS and choose the GCC 64 bit version (aarch64) as shown in the screenshot we provide in the documentation 

    Regards,

    Rahul

  • Hi Rahul,

    Thanks for the suggestion! To clarify, the 9.9.2 instructions state we should be using the compiler version "GNU v7.2.1 (Linaro aarch64)", but only "GNU v7.2.1 (Linaro)" was available to me. Is this the core issue?

    I've looked through the documentation and don't see any instructions on how to detect the 64-bit compiler with CCS. I found this guide that explains how to add a compiler to CCS, but I can't find the 64-bit compiler in the RTOS SDK. Can you please point me to this?

    Thanks,
    Barend

  • Barend,

    That definitely is an issue to fix as the CSL libraries have been compiled using 64 bit compiler and would link to code that is built using 32 bit compiler.

    to detect the 64 bit compiler, please open Project Properties and go to "More"

    Please try to rebuild with these settings. IF this is still something that doesn`t fix the issue, we can try to debug this based on the error log that you run into.

    Regards,

    Rahul

  • Hi Rahul,

    I don't have the Linaro aarch64 option, even when including the processor SDK RTOS and the PDK.

    Thoughts?

    Thanks,
    Barend

  • Update on this, the gcc-linaro directories were in C:\ti, under the names that Rahul had pointed out, but not in the RTOS SDK directory.

    Thanks,
    Barend

  • Hi Rahul,

    Thanks so much for the help , I have fixed my CCS with  your help

    2 things the 64  bit files are not located under RTOS but under a higher directory (TI)

    and after that you need to add the path under CCS General --> more --> tool discover path...

    afte all of this I still got the Entry adress error that I fixed as Barend said by changing the "entry" under basic , gnu linker, to " Entry" 

    problem solved -thank you!