XC2200 Derivatives
System Units (Vol. 1 of 2)
Memory Organization
User’s Manual
3-35
V2.1, 2008-08
MemoryX2K, V1.3
3.9.5
Data Integrity
This section describes means for detecting and preventing the inadvertent modification
of data in the flash memory.
3.9.5.1
Error Correcting Codes (ECC)
With very low probability a flash cell can become disturbed or lose its data value faster
than specified. In order to reach the defined overall device reliability each 128-bit block
of flash data is accompanied with a 9-bit ECC value. This redundancy supplies SEC-
DED capability, meaning “single error correction and double error detection”. All single
bit errors are corrected (and the incident is detected), all double bit errors are detected
and even most triple bit errors are detected but some of these escape as valid data or
corrected data.
A detected error is reported in the register
. Software can select which
type of error should trigger a trap by the means of register
. In the system
control further means exist to modify the handling of errors. The enabled trap requests
by the flash module are handled there as “Flash Access Trap”. In case of a double-bit
error the read data is always replaced with a dummy data word.
3.9.5.2
Aborted Program/Erase Detection
Where the ECC should protect from intrinsic failures of the flash memory that affect
usually only single bits; an interruption of a running program or erase process might
cause massive data corruption:
•
The erase process programs first all cells to 1 before it erases them. So depending
on the time when it is interrupted the data might be in a different state. This can be
the old data, all-one, a random value, a weak all-zero or finally all-zero.
•
The program process programs all bits concurrently from 0 to 1. If it is interrupted not
all set bits might read as 1 or contain a weak 1.
The register
contains the bits ERASE and PROG. These bits stay set until
the next “
” command or System Reset. So if an erase or program process
is interrupted by an Application Reset one of these bits is still set which allows to detect
the interruption. It lies in the responsibility of the software to send the “
command after a finalized program/erase process to enable this evaluation.
Another possible measure against aborted program/erase processes is to prevent resets
by configuring the SCU appropriately.
If a program or erase process was aborted by a Power-On Reset (e.g. due to a power
failure) there do not exist reliable means to detect this by reading the affected flash
range. Even with margin reads an early or late aborted process might go unnoticed
although it might in the long-term affect reliability.