English
Language : 

UPD78F1502AGK-GAK-AX Datasheet, PDF (863/1031 Pages) Renesas Technology Corp – 16-Bit Single-Chip Microcontrollers
78K0R/Lx3
CHAPTER 27 FLASH MEMORY
27.8.1 Boot swap function
If rewriting the boot area failed by temporary power failure or other reasons, restarting a program by resetting or
overwriting is disabled due to data destruction in the boot area.
The boot swap function is used to avoid this problem.
Before erasing boot cluster 0Note, which is a boot program area, by self-programming, write a new boot program to boot
cluster 1 in advance. When the program has been correctly written to boot cluster 1, swap this boot cluster 1 and boot
cluster 0 by using the set information function of the firmware of the 78K0R/Lx3 microcontrollers, so that boot cluster 1 is
used as a boot area. After that, erase or write the original boot program area, boot cluster 0.
As a result, even if a power failure occurs while the boot programming area is being rewritten, the program is executed
correctly because it is booted from boot cluster 1 to be swapped when the program is reset and started next.
Note A boot cluster is a 4 KB area and boot clusters 0 and 1 are swapped by the boot swap function.
XXXXXH
User program
Figure 27-11. Boot Swap Function
Self-programming
to boot cluster 1
User program
Execution of boot
swap by firmware
User program
Self-programming
to boot cluster 0
User program
02000H
01000H
User program
Boot program
0 0 0 0 0 H (boot cluster 0)
Boot
New boot program
(boot cluster 1)
Boot program
(boot cluster 0)
Boot
Boot program
(boot cluster 0)
New boot program
(boot cluster 1)
Boot
New user program
(boot cluster 0)
New boot program
(boot cluster 1)
Boot
In an example of above figure, it is as follows.
Boot cluster 0: Boot program area before boot swap
Boot cluster 1: Boot program area after boot swap
R01UH0004EJ0501 Rev.5.01
847
Jun 20, 2011