Hi all,
When using the S32k118, flexram is configured to emulated EEPROM, which only allows the change from 0 to 1 when erased.However, I found that when I wrote eeprom, the code directly modified the eeprom without first erasing it to 0xFF. I would like to know why this is OK and is there any problem in this way?
Solved! Go to Solution.
When using EEE, you do not erase or program the flash directly. This is done by the EEE state machine. You are writing FlexRAM only which is a normal RAM and it doesn't matter if you write 0->1 or 1->0.
In this mode FlexRAM acts as access point for EEE memory space, and EEE state machine perform flash erase/program operations to NVM (in this mode assigned to E-flash). From user point of view access to FlexRAM is same as access to ordinary RAM.
For detailed description of EEPROM emulation, I would recommend to study AN11983:
https://www.nxp.com/docs/en/application-note/AN11983.pdf
The issue of eeprom erasable does not seem to be described in detail in AN11983, what I do not quite understand is why the simulation of eeprom can be directly programmed from 0 to 1, but not by the erasable operation? Now I can do this by writing 0xFF.I'm worried about the potential risks.
When using EEE, you do not erase or program the flash directly. This is done by the EEE state machine. You are writing FlexRAM only which is a normal RAM and it doesn't matter if you write 0->1 or 1->0.