Const in Flash

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

Const in Flash

766 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.

Tags (1)
0 Kudos
2 Replies

652 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

652 Views
CCandido
Contributor V

Hi Fiona Kuang,

LCF file:

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

tested = ok.

How to, read const address flash not defined?

ex:

int32  c =  @ 0x10000

               or

               @0x150FF2.....or

read for all addres.

thanks,

Carlos.

0 Kudos