S32k怎么把变量 批量的分配到指定的RAM段

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

S32k怎么把变量 批量的分配到指定的RAM段

1,426 Views
jiabingqiang
Contributor I

我定义了很多变量,现在想把他放到我自己定义的RAM段里面,怎么把变量 批量的分配到指定的RAM

.APPL_RAM_DATA :
{
__MY_APPL_RAM_SECTION_START = .;
KEEP(*(.APPL_RAM_DATA))
__MY_APPL_RAM_SECTION_END = .;
} > m_Appl_Ram

 

 

uint16_t GetCNVBuff[4];
uint16_t CalculationResut1,CalculationResut2;
flexcan_id_table_t filterTable[16];
flexcan_msgbuff_t recvMsg0;
flexcan_msgbuff_t recvMsg1;
ftm_state_t ftmStateStruct;
ftm_state_t ftm1StateStruct;

 

 

 

 

how to place variable in allocate ram section?
0 Kudos
Reply
1 Reply

1,416 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

 

use __attribute__ ((section(".APPL_RAM_DATA"))) keyword for variable definition, like

__attribute__ ((section(".APPL_RAM_DATA"))) uint16_t GetCNVBuff[4];

__attribute__ ((section(".APPL_RAM_DATA"))) flexcan_msgbuff_t recvMsg0;

etc

 

BR, Petr

0 Kudos
Reply