TC1796
System Units (Vol. 1 of 2)
Program Memory Unit
User’s Manual
7-34
V2.0, 2007-07
PMU, V2.0
7.2.8
Error Correction and Margin Control
7.2.8.1
Dynamic Error Correction
Error detection and correction are controlled in the Flash module by using a SECDED
algorithm. This algorithm calculates an 8-bit error correction code (ECC) for every 64-bit
data portion in PFLASH and DFLASH. This 8-bit ECC is generated during write
operations to the assembly buffer and programmed into the Flash array together with the
assembly buffer data during the execution of the Write Page command. With every 64-bit
read access from PFLASH and DFLASH, the associated 8-bit ECC is fetched and
checked whether it is correct or not.
The ECC is defined such that an 8-bit ECC of 00
H
is generated for 64-bit data portions
with all bits set at 0. Therefore, after an erase operation all Flash locations including the
ECCs are at logical 0, meaning that the Flash is erased with correct ECC information.
On the other hand, an ECC of FF
H
is generated when all bits of a 64-bit data portion are
programmed with a 1.
In general, the TC1796 Flash module supports the following error detection and
correction functionality for PFLASH and DFLASH read accesses:
•
Single-bit error detection within 64-bit read data with on-the-fly correction
– Status flag indication for PFLASH (FSR.PFSBER) and DFLASH (FSR.DFSBER)
single-bit errors
– Optional single-bit error Flash interrupt generation for PFLASH and DFLASH
•
Double-bit error detection (no correction)
– Status flag indication for PFLASH (FSR.PFDBER) and DFLASH (FSR.DFDBER)
double-bit errors
– Optional double-bit error Flash interrupt generation for PFLASH and DFLASH
– In double-bit error case, the CPU/PCP can be interrupted by a PLMB bus error
which further results in an interrupt from the PLMB bus control unit PBCU.
This PLMB bus error interrupt can be disabled e.g. for margin check purposes.
A single-bit or a double-bit error may also be caused by a disturbed ECC with correct
64-bit data, or by a wrong selection of internal Flash access time with wait states.
Note: After the detection of a single-bit error it is generally recommended to execute a
margin check procedure (described in the next section) and, as a result of this
check, to erase the violated sector and reprogram it completely new (to avoid
double-bit errors).