I have figured out how to use flash memory to persist values in the MCU, like to survive across a power failure. So that is cool.
One last thing is how does one get the CCS C++ compiler/linker to initialize a flash segment? Does anyone have a technique for initializing a segment?
For example, I am mapping the persistent values into SEGMENT_C. The C++ compiler/linker does not, at least as mine is setup, initialize the flash segment. It always has the same values from the last time the program wrote values in there, even when the program is rebuilt and reloaded into the MCU.
I have been experimenting with #pragma location= and #pragma LOCATION(x,address) in an attempt to initialize a static variable into SEGMENT_C. But the C++ compiler is saying those are unknown pragmas.
Does anyone know the technique to get the CCS C++ compiler/linker to initialize a flash memory segment like SEGMENT_C to something like all 0x00 or all 0xFF?
Thank you,