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.

Non-constant initialized data (F2812/CCSv4)

I am trying to write my own F2812 linker command file for a
boot-to-RAM application I am transferring to flash under
CCSv4. In studying SPRA958 ("Running an Application from
Internal Flash Memory on the TMS320F28xxx DSP"), section 3,
I am instructed to locate initialized data:

  float const Pi = 3.14159;

to flash, and uninitialized data:

  int adcReadings[100];

to RAM.  This makes sense. I don't see an assignment for
data that has an initial value:

  float priceOfGas = 3.799;

but could change at run time.  Does this require some kind
of special handling in the source or linker command file?

  • As long as you place the sections per table 1 in the SPRA958 application note, you should be fine. The .cinit section holds the tables for initialized variables and should be loaded into Flash, while the .bss section holds space for the variable and should be loaded into RAM, so it can still be modified at run time.