Using FlexRAM as EEPROM in MK22FX512AVLQ12

Showing results for 
Search instead for 
Did you mean: 

Using FlexRAM as EEPROM in MK22FX512AVLQ12

Contributor I
Hi, I am using MK22FX512AVLQ12 controller for my custom board. As per the datasheet, there is FlexRAM of size 4K available on the controller which can be used as EEPROM. I would like to know what is the correct way partition/ configure the FlexRAM to use as EEPROM. As there are no SDK examples available for this controller, please provide a sample code if possible. Thanks & regards, Vaibhavi P
0 Kudos
2 Replies

NXP TechSupport
NXP TechSupport


Hope you are well. The Application Note AN4282 might be helpful:

Regarding the example, I suggest you download the SDK from the FRDM-KE15Z board. There you can find the example "flexnvm_eeprom".
KE15Z and MK22 flash commands work similarly, the only difference is the FlexNVM and FlexRAM memory size.

Let me know if this is helpful, if you have more questions do not hesitate to ask me.
Best regards,

0 Kudos

Contributor I


Thank you for your suggestions. I tried the example you suggested and able use FlexRam as EEPROM. But I have one doubt regarding the partitioning command used. As per my understanding, if I have used Partitioning command once, it should remained partitioned like that for the rest of life of device.  But when I terminate and debug again, I get eepromTotalSize as 0 by following function.

FLASH_GetProperty(&g_st_flashDriver, kFLASH_PropertyEepromTotalSize, &eepromTotalSize);

Hence the program again executes the Partitioning command and also Data stored in EEPROM is lost.

My intention is to save important parameters in EEPROM which will not be erased even when the controller is turned OFF. I want to read those parameters when the controller is powered ON again.

Please suggest How can I ensure that partition and flexRAM configuration as EEPROM happens only once and remains the same for rest of the device life and also data saved in EEPROM is not lost during power OFF and ON of controller

Please help in resolving the doubt.

Thanks & Regards,

Vaibhavi P

0 Kudos