29.4.12 ECC Errors and Corrections

The Flash embeds an ECC module able to correct one unique error and to detect two errors. The errors are detected while a read access is performed into memory array and stored in EEFC_FSR (see EEFC_FSR). The error report is kept until EEFC_FSR is read.

There is one flag for a unique error on lower half part of the Flash word (64 LSB) and one flag for the upper half part (MSB). Multiple errors are reported in the same way.

Due to the anticipation technique to improve bandwidth throughput on instruction fetch, a reported error can be located in the next sequential Flash word compared to the location of the instruction being executed, which is located in the previously fetched Flash word.

If a software routine processes the error detection independently from the main software routine, the entire Flash located software must be rewritten because there is no storage of the error location.

If only a software routine is running to program and check pages by reading EEFC_FSR, the situation differs from the previous case. Performing a check for ECC unique errors just after page programming completion involves a read of the newly programmed page. This read sequence is viewed as data accesses and is not optimized by the Flash controller. Thus, in case of unique error, only the current page must be reprogrammed.

A set of four similar ECC flags is available for the lock bits protection in EEFC_FSR.

Two Single Error Correction and two Multiple Error Detection flags protect respectively the 64 MSBs and 64 LSBs of the lock bits.