Mike Fugere

Constant declarations @ fixed flash address via template?

Discussion created by Mike Fugere on Oct 8, 2008
Latest reply on Oct 23, 2008 by Pascal Irrle
Hello,
I understand from searching older threads that CW for DSP56F8xxx does NOT support declarations of constants @ fixed address - for example, I would like the generated S-Record Code image of my application code to have its revision information stored into fixed location in dataflash, e.g., for application firmware revision "1.2.3":
UInt16 FWMajorRev@0x7B00 = 1;
UInt16 FWMinorRev@0x7B01 = 2;
UInt16 FWMaintRev@0x7B02 = 3;

I obviously do not want to have application code write this to flash every time it runs as
that is time consuming and could contribute to flash wear issues.   I know I can define a section in the linker .cmd file for the project to store this info, but if I allow CW to generate new linker file (as future code changes, variable additions cause expansion of .bss sections, etc.) it will overwrite my modified .cmd file with the special section.
.x_AppFWRev (R) : ORIGIN=0x7B00, LENGTH=0x0003
...
...
.AppFWRevision :
{
  #Major Rev
WRITEH(1);
 #Minor Rev
WRITEH(2);
 #Maint Rev
 WRITEH(3)
} > .x_AppFWRev

 IS there a way to create a "template" with CW that would use my specially coded cmd file as a template or not eliminate my special section, but still allow it to create the .cmd file to accomodate future code changes ?  

I am trying to avoid having to document procedure for copying older .cmd files, writing code, generating new linker .cmd file, and copying /pasting from older .cmd files into new .cmd file and disabling the automatic linker file generation in PE repeatedly.

Any advice/help is appreciated !

Outcomes