Const in Flash

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Const in Flash

1,901 次查看
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.

标记 (1)
0 项奖励
回复
2 回复数

1,787 次查看
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 项奖励
回复

1,787 次查看
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 项奖励
回复