RL78/G15 CHAPTER 19 FLASH MEMORY
R01UH0959EJ0110 Rev.1.10 Page 681 of 765
Mar 7, 2023
19.6.3 Notes on self-programming
(1) Allocate the self-programming code for rewriting the code/data flash area to the code flash area. Self-programming
by fetching from the RAM is prohibited. Additionally, rewriting the boot area and the block for storing the self-
programming code is prohibited.
(2) Prohibit an interrupt before setting the self-programming mode. To prohibit an interrupt, clear (0) the IE flag by the
DI instruction in the same way as in the normal operation mode.
(3) When using the flash memory sequencer to rewrite the code/data flash memory, set the value corresponding to
the CPU operating frequency in the FSET4-0 bits of the FSSET register before proceeding. Note that if rewriting is
attempted while the value corresponding to the CPU operating frequency is not correct, operation is undefined and
written data are not guaranteed. Even if the values in the flash memory are as expected immediately after
rewriting, retaining the values for any specified period is not guaranteed.
(4) The high-speed on-chip oscillator should be kept operating before executing self-programming. If it is stopped, it
should be made to operate again (HIOSTOP = 0), and the flash self-programming code should be re-executed
after 30 μs have elapsed.
(5) Do not execute other settings or instructions which are not related to the self-programming procedure during the
self-programming execution flow shown in 19.6.2 Procedure for executing self-programming of code/data
flash memory.
(6) The CPU is stopped during rewriting through self-programming. The code flash or data flash memory cannot be
accessed while it is being rewritten.