Const define and read.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Const define and read.

734 Views
CCandido
Contributor V

Hi,

my teste have dificulty for defines ( const uint32)  location and read, in flash memory.

CW for MPC55xx v2.10.

MCU MPC5634

 

which ways of defining constant in a given address in flash.

ex: DEFINE MY_DWORD @ 0x10000 = { VALUE};

 

which ways to make reading at a specific address in flash.

uint32 c = MY_DWORD;

 

which ways to make free reading on the memory flash.

 

uint32  c = MY_DWORD + i;

 

thanks,

Carlos.

Labels (1)
Tags (1)
0 Kudos
1 Reply

390 Views
TICS_Fiona
NXP Employee
NXP Employee

Please see the code below for how to link your constants as expected:

in the C file :

#pragma section RW ".NM_CONST" ".NM_CONST"

__declspec(section ".NM_CONST" )

static const UINT8 NM_BIT_BYTE_POS[NM_NUM_BITS_IN_BYTE] =

{

    0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01

} ;

with this added to the LCF file:

SECTIONS

{

......

  GROUP:{

        .NM_CONST (CONST) LOAD (ADDR(nm_const_flash)) : {}

    }> nm_const_flash

......

}

Fiona Kuang

Technical Information & Commercial Support

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos