Create a ProgramSection in Flash. Not working.
I am trying to create a const version number at a specific location in flash.
In my .c file:
#pragma constseg("VERSION")
const volatile WORD ver = 100;
#pragma constseg(default)
In my section_placement file:
...
<MemorySegment name="FLASH">
<ProgramSection load="Yes" name="ISR" />
<ProgramSection load="Yes" name="CONST"/>
<ProgramSection load="Yes" name="CODE" />
<ProgramSection size="2" load="Yes" start="0xFF90" name="VERSION" />
<ProgramSection size="68" load="Yes" start="0xFFA0" name="CHECKSUM"/>
<ProgramSection size="32" load="Yes" start="0xFFE0" name="INTVEC" />
</MemorySegment>
...
I am doing this now with const calibration data in different sections (D,C, & B) and with the compiler generated checksum. My .map file and .hex file are coming back without that section. I have no idea what I am missing here...
-
I still have not found a solution to my problem. I have added command line argument -K_ver per manual... Also included _ver in the keep symbols option under linker properties. The only way I get this to work is if I set up a dummy instruction in main to equal _ver. This is obviously specific to the compiler so I would think I could get a little more help on this issue...
-
This is covered in the documentation:
http://www.rowleydownload.co.uk/documentation/msp430_2_0/hcl_option_keep_symbol.htm
Please sign in to leave a comment.
Comments
13 comments