Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed the week of November 23.

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.

C29-CGT: c29clang: --honor_cmdfile_order still incorrect in v2.2.2

Part Number: C29-CGT

Hi,

While the minimum reproduction raised in EXT_EP-13450 has been fixed in C29-CGT version 2.2.2.LTS (as noted in Readme for C29 Code Generation Tools v2.2.2.LTS), there still seems to be a related issue with the option.

This issue (which shows up on both v2.2.1 and v2.2.2) is more complicated to trigger, from what I can tell it requires run addresses to two different memory blocks where the output sections are ordered one way and the physical addresses are ordered the other way (it also requires another output section in at least one of the memory blocks).

I have attached a new minimum reproduction (test.zip), as with the last one, executing `C:\ti\ccs2031\ccs\tools\compiler\ti-cgt-c29_2.2.2.LTS\bin\c29clang.exe main.c test.cmd` in this folder should result in a `test.map` file being generated.

The desired order from this is .text, .ram_func, .data, .bss while the actual order is .text, .data, .ram_func, .bss.

Regards, William

  • Please clarify your expectation.  The linker command file has these lines:

    SECTIONS
    {
        .text :
        {
            *(.text)
        } > flash, run > ram_prog
    
        .ram_func :
        {
            *(.ram_func)
        } > flash, run > ram_prog
    
        .data :
        {
            *(.data)
        } > flash, run > ram_data
    
        .bss :
        {
            *(.bss)
        } run > ram_data
    }

    Just for now, focus on the run address of each section, and ignore the load address.  In the memory range ram_prog, .text is before .ramfunc. In the memory range ram_data, .data is before .bss.  When you carefully look at the run address of each section in the map file, that is what happens.   Is this the desired result?  Or, do you expect --honor_cmdfile_order to affect the load address and ignore the run address?

    Thanks and regards,

    -George

  • Hi,

    I may just be wrong with my expectations of --honor_cmdfile_order and this may well be unreasonable or infeasible. I was expecting it to affect both the load address and the run address as they are in different memory blocks, so the addresses in RAM would stay the same (.text before .ram_func, .data before .bss) but the addresses in Flash would also be ordered as they are in the file (.text then .ram_func then .data).

    Thanks, William

  • The option --honor_cmdfile_order only affects the run address of a section, and never the load address.  The load address is allocated with the usual linker methods.  I filed EXT_EP-13682 to request the documentation be updated to explain these details.  

    I can understand how you might be surprised by this behavior.  But does it cause any problems for your system?  Do you need the load address of the sections to be in a specific order?  If so, please explain that use case in detail.

    Thanks and regards,

    -George

  • It was something I was experimenting with to reduce the number of APRs required to cover everything (using sections rather than the suggested memory blocks so that they would automatically resize depending on use), because then we could group most of the flash into one APR, rather than one for `.data`, one for `.text` etc. (because we don't know what order they will be in).

    This is fine to work around though because in practice we have plenty of spare APRs, and we will probably end up simplifying our access protection to the point where this isn't a problem anyway, as we only really need it for preventing cross-core issues.

    Thanks for the clarification, William