
686
RD VF PR ER FLER = 0
Error
occurrence
*
1
RES
= 0 or
STBY
= 0
RES
= 0 or
STBY
= 0
RD
VF
PR
ER
FLER = 0
Normal operation mode
Program mode
Erase mode
Reset or hardware standby
(hardware protection)
RD VF
*
4
PR
ER
FLER = 1
RD
VF
PR
ER
FLER = 1
Error protection mode
Error protection
mode (software standby,
sleep, subsleep, and watch )
Software standby,
sleep, subsleep, and
watch mode
FLMCR1, FLMCR2 (except
FLER bit), EBR1, EBR2
initialization state
*
3
FLMCR1,
FLMCR2,
EBR1, EBR2
initialization
state
Software standby,
sleep, subsleep, and
watch mode release
RD: Memory read possible
VF: Verify-read possible
PR: Programming possible
ER: Erasing possible
RD
: Memory read not possible
VF
: Verify-read not possible
PR
: Programming not possible
ER
: Erasing not possible
Legend:
RES
= 0 or
STBY
= 0
Error occurrence
*
2
Notes: 1. When an error occurs other than due to a SLEEP instruction, or when a SLEEP instruction is
executed for a transition to subactive mode
2. When an error occurs due to a SLEEP instruction (except subactive mode)
3. Except sleep mode
4.
VF
in subactive mode
Figure 22.14 Flash Memory State Transitions
22.9
Interrupt Handling when Programming/Erasing Flash Memory
All interrupts, including NMI input is disabled when flash memory is being programmed or erased
(when the P or E bit is set in FLMCR1), and while the boot program is executing in boot mode*
1
,
to give priority to the program or erase operation. There are three reasons for this:
1. Interrupt during programming or erasing might cause a violation of the programming or
erasing algorithm, with the result that normal operation could not be assured.
2. In the interrupt exception handling sequence during programming or erasing, the vector would
not be read correctly*
2
, possibly resulting in MCU runaway.
3. If interrupt occurred during boot program execution, it would not be possible to execute the
normal boot mode sequence.