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.

Compiler/TMS320F28377D: Is it necessary to rename section "ramfuncs" into ".TI.ramfunc" after compiler upgrade?

Part Number: TMS320F28377D
Other Parts Discussed in Thread: CONTROLSUITE

Tool/software: TI C/C++ Compiler

Hi, there.
According to controlSUITE for "2837xD" with ver. 210, it changes "ramfuncs" into ".TI.ramfunc" depending on compiler version. For our company, we developed the code for a few years. At start, we named all programming section on flash like:
 
In .c file
#pragma CODE_SECTION(some_function, "ramfuncs");
In flash linker (cmd file)
ramfuncs: LOAD = FLASHEN,
RUN = CPU1RAMGS,
LOAD_START(_RamfuncsLoadStart),
LOAD_SIZE(_RamfuncsLoadSize),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
RUN_SIZE(_RamfuncsRunSize),
RUN_END(_RamfuncsRunEnd),
PAGE = 0, ALIGN(4)
Then, some day we just upgraded the compiler version from v6.2.7 to v18.12.5, without changing keyword "ramfuncs" into ".TI.ramfunc". It seemed to work fine (for now) but not identical to your suggested coding. In addition, we searched a lot posts talking about this naming work if user updates their compiler.
 
Here are my questions:
  1. What will happen if we just keep those name with compiler v18.12.5 ? Does flash program still work normally as before we changed our compiler ?
  2. If ".TI.ramfunc" naming is necessary, what should I create another flash program section and name it ? Is section valid to be named like ".TI.ramfunc2" ? What are the naming rules?
Sincerely
Henry
  • The overall problem being solved is: To make the code run faster, copy some functions from flash to RAM during system startup, then execute them from RAM.  Before the compiler supported the command line option --ramfuncs, customers implemented their own solution, and it is often similar to the solution you use now.  After --ramfuncs was added, solving this problem is easier.    

    Henry Teng said:
    What will happen if we just keep those name with compiler v18.12.5 ?

    It continues to work the same way.

    Henry Teng said:
    Does flash program still work normally as before we changed our compiler ?

    Yes.

    Some confusion might result if, at some later point, you try to use --ramfuncs in combination with your current solution.  It might happen that some of the functions get copied to RAM, and others don't, or something like that.  I don't know whether you should worry about this possibility.  If you are worried about it, then you could change your linker command file to something like this ...

    ramfuncs: 
    {
       *(ramfuncs)
       *(.TI.ramfunc)
    }
    LOAD = FLASHEN,
    RUN = CPU1RAMGS,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRunSize),
    RUN_END(_RamfuncsRunEnd),
    PAGE = 0, ALIGN(4)

    This creates an output section named ramfuncs.  It is made up of all the input sections named ramfuncs or .TI.ramfunc.  Just like it works now, this output section starts in flash, and the startup code copies it to RAM for execution.  With this syntax, if a function is designated for execution in RAM with #pragma CODE_SECTION or by using the command line option --ramfuncs, this output section will contain that function.

    Thanks and regards,

    -George