How can S32K define a variable in a specified address?

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

How can S32K define a variable in a specified address?

1,257 Views
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!

Labels (1)
0 Kudos
2 Replies

823 Views
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 Kudos

823 Views
zhengjianfei
Contributor II

Hi Jiri,thanks! 
 

0 Kudos