how to put a variable on S32k eeprom

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

how to put a variable on S32k eeprom

3,283 次查看
momo12
Contributor III

Hi

how can I put a variable on s32k eeprom?

__eeprom unint32_t MyVariable. doesnt work.

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

2,791 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,
The EEPROM is accessible in FlexRAM so you can use a pointer on a location in FlexRAM.

Regards,
Daniel

0 项奖励
回复

2,791 次查看
momo12
Contributor III

What is the compiler directive to put a variable/Array on Flexram then?

0 项奖励
回复

2,791 次查看
jiri_kral
NXP Employee
NXP Employee

Hi, 

you can use PE Micro partition feature and add your data into FlexRAM section (already partitioned by PE Micro as emulated eeprom) by __attribute__ specifier. You can find partition option in debug configurations -> Advanced Options

pastedImage_1.png

pastedImage_2.png

You can find more details about EEESIZE and DEPART in reference manual. 

Modify your linker file and add flexram section - like this: 

pastedImage_3.png

And add your variable in .eeeprom section - for example in your main.c:

pastedImage_4.png

Here is an example related to this topic - Example: S32K144 EEEPROM usage 

Hope it helps. 

Jiri 

0 项奖励
回复