
R8C/3GM Group
R01UH0284EJ0100 Rev.1.00
Aug 09, 2011
31.7
Notes on Flash Memory
31.7.1
CPU Rewrite Mode
31.7.1.1
Prohibited Instructions
The following instructions cannot be used while the program ROM area is being rewritten in EW0 mode
because they reference data in the flash memory: UND, INTO, and BRK.
31.7.1.2
Interrupts
FMR21, FMR22: Bits in FMR2 register
Table 31.9
CPU Rewrite Mode Interrupts (1)
Mode
Erase/
Write
Target
Status
Maskable Interrupt
EW0
Data
flash
During auto-erasure
(suspend enabled)
When an interrupt request is acknowledged, interrupt handling is executed.
If the FMR22 bit is set to 1 (erase-suspend request enabled by interrupt request),
the FMR21 bit is automatically set to 1 (erase-suspend request). The flash memory
suspends auto-erasure after td(SR-SUS).
If erase-suspend is required while the FMR22 bit is set to 0 (erase-suspend request
disabled by interrupt request), set the FMR21 bit to 1 during interrupt handling. The flash
memory suspends auto-erasure after td(SR-SUS).
While auto-erasure is being suspended, any block other than the block during auto-
erasure execution can be read or written. Auto-erasure can be restarted by setting the
FMR21 bit to 0 (erase restart).
During auto-erasure
(suspend disabled
or FMR22 = 0)
Interrupt handling is executed while auto-erasure or auto-programming is being
performed.
During
auto-programming
Program
ROM
During auto-erasure
(suspend enabled)
Usable by allocating a vector in RAM.
During auto-erasure
(suspend disabled)
During
auto-programming
EW1
Data
flash
During auto-erasure
(suspend enabled)
When an interrupt request is acknowledged, interrupt handling is executed.
If the FMR22 bit is set to 1, the FMR21 bit is automatically set to 1. The flash memory
suspends auto-erasure after td(SR-SUS).
If erase-suspend is required while the FMR22 bit is set to 0, set the FMR21 bit to 1 during
interrupt handling. The flash memory suspends auto-erasure after td(SR-SUS).
While auto-erasure is being suspended, any block other than the block during auto-
erasure execution can be read or written.
Auto-erasure can be restarted by setting the
FMR21 bit to 0.
During auto-erasure
(suspend disabled
or FMR22 = 0)
Interrupt handling is executed while auto-erasure or auto-programming is being
performed.
During
auto-programming
Program
ROM
During auto-erasure
(suspend enabled)
Auto-erasure suspends after td(SR-SUS) and interrupt handling is executed. Auto-
erasure can be restarted by setting the FMR21 bit to 0 after interrupt handling completes.
While auto-erasure is being suspended, any block other than the block during auto-
erasure execution can be read or written.
During auto-erasure
(suspend disabled
or FMR22 = 0)
Auto-erasure and auto-programming have priority and interrupt requests are put on
standby. Interrupt handling is executed after auto-erase and auto-program complete.
During
auto-programming