Hi,
ECC error can occur:
- when erase/program operation is terminated by unexpected reset, so the flash is left in undetermined state.
- when we program double word which is not fully erased (over-programming)
- when too many erase/program cycles have been performed (wear-out)
In case of EEPROM Emulation, the most common reason is unexpected reset.
Flash block dedicated for EEPROM do not report ECC errors to the MEMU. Single bit errors are corrected, multi-bit errors are replaced by fixed word 0x1555_1555 (representing an illegal instruction) and are not forwarded to the MEMU. It is user responsibility to check the returned value and also corresponding flags.
EEPROM Emulation driver use EER_OPTION to distinguish between devices. All MPC56xx and also MPC5777C use exception handler, other MPC57xx works as described above.
When ECC error occurs in the flash, the solution is to erase affected block. EEPROM Emulation driver does that automatically.
Regards,
Lukas