Hope you are well. The Application Note AN4282 might be helpful: https://www.nxp.com/docs/en/application-note/AN4282.pdf
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.
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,