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/TCI6630K2L: Keystone II: Bare metal ARM project with RTSC platform

Part Number: TCI6630K2L
Other Parts Discussed in Thread: TMS320C6678,

Tool/software: Code Composer Studio

Hi All!

My CCS setup is as follows:

  • CSS v7.4.0.00015
  • SYS/BIOS v6.52.0.12
  • XDCTools v3.50.4.43

I have a problem generating bare metal ARM project using Code Composer Studio v7.4. I am able to create empty project using GNU 6.3.1 tool-chain. And it compiles.

The next step, as I think from my previous experience with TMS320C6678, is creation of RTSC platform for the project.

It is also created fine and I'm able to select it in General->Products tab of project settings.

But compilation of the whole project fails with these messages:

makefile:145: recipe for target 'test_arm.out' failed
C:\Tools\ti\bios_6_52_00_12\packages\gnu\targets\arm\rtsv7A\lib\boot.aa15fg(startup.oa15fg): In function `_fini':
/db/ztree/library/trees/xdctargets/xdctargets-o04/src/gnu/targets/arm/rtsv7A/startup.c:95: multiple definition of `_fini'
c:/tools/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/hard/crti.o:(.fini+0x0): first defined here
C:\Tools\ti\bios_6_52_00_12\packages\gnu\targets\arm\rtsv7A\lib\boot.aa15fg(startup.oa15fg): In function `gnu_targets_arm_rtsv7A_startupC':
/db/ztree/library/trees/xdctargets/xdctargets-o04/src/gnu/targets/arm/rtsv7A/startup.c:48: multiple definition of `__dso_handle'
c:/tools/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/hard/crtbegin.o:(.data+0x0): first defined here
C:\Tools\ti\bios_6_52_00_12\packages\gnu\targets\arm\rtsv7A\lib\boot.aa15fg(startup.oa15fg): In function `gnu_targets_arm_rtsv7A_startupC':
/db/ztree/library/trees/xdctargets/xdctargets-o04/src/gnu/targets/arm/rtsv7A/startup.c:87: undefined reference to `xdc_runtime_System_exit__E'
collect2.exe: error: ld returned 1 exit status

So this is some kind of conflict with SYS/BIOS libraries. These errors can be fixed commenting lines of generated linker.cmd which refer to boot.aa15fg and syscalls.aa15fg libraries:

INPUT(
    "C:\Users\win7user\workspace_v7\test_arm\Debug\configPkg\package\cfg\build_pa15fg.oa15fg"
    //"C:\Tools\ti\bios_6_52_00_12\packages\gnu\targets\arm\rtsv7A\lib\boot.aa15fg"
    //"C:\Tools\ti\bios_6_52_00_12\packages\gnu\targets\arm\rtsv7A\lib\syscalls.aa15fg"
)

But after this a warning "cannot find entry symbol _c_int00; defaulting to 008000d8" arrives, which definitely promises further troubles.

My project does not use SYS/BIOS, so what is the proper way to create project (and RTSC platform) without it? Maybe I need to create RTSC configuration file (or edit some files inside RTSC platform) to disable linking with SYS/BIOS libraries?

  • Yurii,

    Why do you want a RTSC based project if you are not using SYS/BIOS?

    Todd
  • Todd,

    Actually I used RTSC (without SYS/BIOS) in my previous Keystone 1 project (C6678). For example, I've added CSL library in RTSC configuration file and it was the only way to make it appear in CSS include paths without hard coding them.

    The other usage of RTSC configuration file is nice managing of sections in generated linker script.

    So there was no SYS/BIOS references in generated *.out file, passing --rtsName="" to XDCTools. Only one stub xdc* function was referenced in *.map file.

    Yesterday I've tried to create C6x project for the TCI6630K2L processor with the same RTSC-using logic and everything went fine. I'm able to create c6x project without SYSS/BIOS and get RTSC advantages at the same time.

    Yurii

  • Yurii Monakov said:
    Yesterday I've tried to create C6x project for the TCI6630K2L processor with the same RTSC-using logic and everything went fine. I'm able to create c6x project without SYSS/BIOS and get RTSC advantages at the same time.

    So I can close this thread out then...correct?

    Todd

  • ToddMullanix said:
    So I can close this thread out then...correct?

    No, original issue is not resolved. I'm still unable to create ARM platform without linking SYS/BIOS libraries.

  • Yurii,

    I'm not able to reproduce your error. Can you attach the sample project?

    Todd
  • Todd,

    Sorry for the late answer. I've finally managed to get successful bare metal ARM project compilation with RTSC.
    But the way was not so easy. These are the problems which one should overcome on this thorny path:

    1. There is NO NEED in separate RTSC configuration file if you have custom RTSC platform. If you have separate RTSC configuration, CCS will build it first and then build RTSC platform in the same folder. So the second build will overwrite all files (including linker script) of custom RTSC configuration. This is very confusing because changes in cfg file are not reflected in the linker script. If you choose one of the standard/evm platforms, the build magically happens only once.
    Another problem with separate configuration file is parallel builds. If you have this option turned on, make utility will run build of RTSC configuration and RTSC platform in parallel. This results in file system race conditions, because these processes write in the same directory. The build can finish successfully and fail with equal probability.
    Maybe there is some way to set dependencies between RTSC platform and RTSC configuration, but I have not found it.
    3. To customize linker script and linked libraries one should edit package/build.cfg file in custom RTSC platform directory.
    4. To disable linking with SYS/BIOS libraries pass --rtsName="" parameter to XDC tools. After this linker will complain about missing entry point (_c_int00). This could  be fixed setting "Set start address" in GNU linker options to _start (standard C entry point).
    5. There is another problem if you want to link CSL libraries into the project. In C66x project this can be achieved with these lines in platform's build.cfg:

        var cslSettings = xdc.useModule('ti.csl.Settings');
        cslSettings.deviceType = "k2l";

    But this will not work in ARM project (linker will complain about missing xdc_* functions). Surprisingly the correct behaviour can be achieved with these lines:

        var cslPackage = xdc.loadPackage('ti.csl');
        cslPackage.Settings.deviceType = "k2l";

    6. Did not investigated this to much, but there is some kind of dependency on XDC repositories path order (found on c66x project). The one working is:
        - custom platform path (local to the project in my case)
        - SYS/BIOS path
        - PDK path

    In attachment you can find my test workspace with 3 projects:

    1. Bare metal c66x RTSC project
    2. Bare metal a15f RTSC project (with CSL linked trough platform's build.cfg)
    3. Bare metal a15f non-RTSC project (for reference)

    k2l_test.zip

    Best Regards,

    Yurii