How can S32K define a variable in a specified address?

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

How can S32K define a variable in a specified address?

2,008 次查看
zhengjianfei
Contributor II

Sometimes we need to define a variable in a specified address,but how to do this?The MCU is S32K144 and IDE is S32DS V2.0. I have tried to use the following method :1.unsigned char temp_A@0x00.  2.u8 sram[200] __attribute__((at(0x20002000)));   ,but it did not work!So dose anyone have any idea about this problem,thanks very much!

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

1,574 次查看
jiri_kral
NXP Employee
NXP Employee

Hi, 

you need to create custom section in linker file and add your variable like this:

__attribute__ ((section(".your_section"))) unsigned char your_variable;

You can look at this thread - https://community.nxp.com/message/971236 

Jiri

0 项奖励
回复

1,574 次查看
zhengjianfei
Contributor II

Hi Jiri,thanks! 
 

0 项奖励
回复