Rev. 1.0, 02/00, page 155 of 1141
7.6.3
Error Protection
In error protection, an error is detected when MCU runaway occurs during flash memory
programming/erasing, or operation is not performed in accordance with the program/erase
algorithm, and the program/erase operation is aborted. Aborting the program/erase operation
prevents damage to the flash memory due to overprogramming or overerasing.
If the MCU malfunctions during flash memory programming/erasing, the FLER bit is set to 1 in
FLMCR2 and the error protection state is entered. The FLMCR1, FLMCR2, EBR1, and EBR2
settings are retained, but program mode or erase mode is aborted at the point at which the error
occurred. Program mode or erase mode cannot be re-entered by re-setting the P or E bit.
However, PV1, PV2, EV1 and EV2 bit setting is enabled, and a transition can be made to verify
mode.
FLER bit setting conditions are as follows:
•
When flash memory is read during programming/erasing (including a vector read or instruction
fetch)
•
Immediately after exception handling (excluding a reset) during programming/erasing
•
When a SLEEP instruction (including standby) is executed during programming/erasing
Error protection is released only by a reset and in hardware standby mode.
Figure 7.14 shows the flash memory state transition diagram.
: Memory read possible
: Verify-read possible
: Programming possible
: Erasing possible
RD
VF
PR
ER
[Legend]
: Memory read impossible
: Verify-read impossible
: Programming impossible
: Erasing impossible
PR ER FLER = 0
Error occurrence
Error occurrence
Power-down mode
= 0
= 0
= 0
P
FLER = 0
Program mode
Erase mode
Reset
(hardware protection)
RD VF
FLER = 1
FLER = 1
Error protection mode
Error protection
mode (power-down mode)
Power-down mode
FLMCR1, FLMCR2 (except FLER bit), EBR1, EBR2
initialization state
FLMCR1, FLMCR2,
EBR1, EBR2 initialization
state
Power-down mode release
Figure 7.14 Flash Memory State Transitions