AnsweredAssumed Answered

Place variable at specific location in data flash

Question asked by Steffen Schütz on Apr 4, 2012
Latest reply on Mar 2, 2017 by stanish

Hi,

I need to place a char* at location 2005 in the data flash. Just to be certain about circumstances, the code is meant for the  DSC56000/E family (56F803 and 56F8357). As IDE I'm using CodeWarrior for DSC56800/E version 8.2.3 build 7.

To get the variable in place, on code side I tried the following:

In the .h file:

#pragma define_section SECDSPDESCRIPTION ".DspDescription" R

and in the .c file either:

 __declspec(SECDSPDESCRIPTION) char* gl_mca_dsp_description = "CB 137 LD 144 NumAct 2";

 or:

 

#pragma section SECDSPDESCRIPTION begin __declspec(SECDSPDESCRIPTION) char* gl_mca_dsp_description = "CB 137 LD 144 NumAct 2";#pragma section SECDSPDESCRIPTION end

In the linker .cmd file I added the following lines:

 

MEMORY {        .x_ReservedDescription  (R) : ORIGIN = 0x00002006, LENGTH = 0x00000020....SECTIONS {  .DspDescription : {       __START_SECDESCRIPTION = .;       *(.DspDescription)       __END_SECDESCRIPTION = .;       #. = ALIGN(0x1);    } > .x_ReservedDescription

 

 

But looking at the xMAP file: it doesn't map the variable to the according section.

 

Anybody got any thoughts on that? Or even experiences?

 

I would be more than thankfull!

 

Regards, Steffen

Outcomes