AnsweredAssumed Answered

MPC56xx Linking const

Question asked by Dermot Murphy on Nov 11, 2014
Latest reply on Nov 11, 2014 by Fiona Kuang

Hi,

 

I would like to link a const into a named section in flash on th eMPC5602.

 

I am trying this in the C file :

 

#pragma section sconst_type const_type ".NM_CONST" ".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:

MEMORY

{

    nm_const_flash:        org = 0x00030000,    len = 0x00000200

}

 

SECTIONS

{

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

}

 

However when I check the map file, the data is located in .rodata

 

How do I move the const array NM_BIT_BYTE_POS into the named section?

Outcomes