AnsweredAssumed Answered

How to force varibles sequentially in RAM for Kinetis KDSv3

Question asked by Carl Norman on Jan 9, 2017
Latest reply on Jan 10, 2017 by Alice_Yang

HI Guys,

 

I already do what I need on ColdfireV2 with Codewarrior10.2 with some linker / pragma's in CW for Coldfire, just wondering how I do this in KDS for my KL27.

 

I have a C file with a bunch of RAM defined how I want, it needs to be sequential as it will be mirrored in EEPROM externally i.e. I have a basically a C file something like this for cold fire. The file will grow with remote updates so we can easily detect and see what the size is etc and intialise the EEPROM.

 

#pragma explicit_zero_data on
#pragma force_active on

 

volatile uint_32 EEPROM_TABLE_SIZE = 0;

volatile uint_32 EEPROM_INIT_VALUE = NVM_FIRST_BOOT_VALUE; 
volatile uchar VD_CompileDate[18] = __DATE__; //Compile Date
volatile uchar VD_CompileTime[14] = __TIME__; //Compile Time

//pages of EEPROM varibles used for programming updating and defaulting the EEPROM on first boot go here
volatile uchar LAST_ADDRESS_MARKER = 0; //36215048 THIS IS TO BE LEFT AT THE END SO YOU CAN WORK OUT WHAT VALUE TO PUT IN Protect_Memory_From_RSU

#pragma explicit_zero_data off
#pragma force_active off

 

This worst great in CW10.7 on my MCF52259. In the linker I do some things to put it at a specific address, but I dont really need that, I just need all this data in sequence for my KL27.

 

Does anyone know how to make it put all my variables to be initialised (even zero) and keep all those even if not used? 

 

Happy to hear of different / easier ways to do this. I was thinking of making a big struct maybe, not sure yet.

Outcomes