how to put a variable on S32k eeprom

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

how to put a variable on S32k eeprom

1,571 Views
momo12
Contributor III

Hi

how can I put a variable on s32k eeprom?

__eeprom unint32_t MyVariable. doesnt work.

Tags (1)
0 Kudos
3 Replies

1,079 Views
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 Kudos

1,079 Views
momo12
Contributor III

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

0 Kudos

1,079 Views
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 Kudos