In fact I never met with such issue.
ERSVIF0 bit:
The setting of the ERSVIF0 flag indicates that the memory controller was unable to format a D-Flash EEE sector for EEE use. The ERSVIF0 flag is cleared by writing a 1 to ERSVIF0. Writing a 0 to the ERSVIF0 flag has no effect on ERSVIF0. While ERSVIF0 is set, it is possible to write to the buffer RAM EEE partition but the data written will not be transferred to the D-Flash EEE partition.
So, ERSVIF0 can be cleared, however I suppose that this will not solve root cause of this issue.
Critical EEE Fault Flags
The access error (ACCERR) bit will be set by:
• The Enable EEE and Disable EEE commands if there is no EEE partition defined
• Either of the partition D-flash commands if an illegal partition ratio is requested
• The Enable EEE command if there is no EEE partition defined
• Errors encountered while initializing the EEE RAM during the FTM reset sequence
The MGSTAT0 and MGSTAT1 bits will set following reset for:
• The Partition D-flash command if an EEE partition is already defined
• Unrecoverable fault reading EEE partition information —in this case, the EEE feature is disabled
with ERPART => 0x0000 and DFPART => 0xFFFF
• Double fault detected reading the EEE protection byte in the flash configuration field—in this case,
the EPROT register is loaded with 0x7F = EEE RAM fully protected
So, from this description it seems that Partitioning was not successfully or data in IFR was damaged.
- Please check if FCLKDIV register is correctly set after every MCU reset.
- Please check DFPART (0x12_0000 – 0x12_0001) and ERPART (0x12_0004 – 0x12_0005) values in IFR field. You can also check duplicates at global addresses 0x12_0002 – 0x12_0003 and 0x12_0006 – 0x12_0007. These data will be available after command MMCCTL1_EEEIFRON = 1; //enable EEEIFR in memory map
Unfortunately there isn’t any other way how restore data in IFR field except Mass Erase Blocks command.
In attachment you can find simple example code and short description of EEEPROM at S12XEP100.