CHAPTER 21 FLASH MEMORY
Preliminary User’s Manual U16846EJ1V0UD
354
21.8 Boot Swap Function
The 78K0/KB1+ has a boot swap function.
Even if a momentary power failure occurs for some reason while the boot area is being rewritten by self-
programming and the program in the boot area is lost, the boot swap function can execute the program correctly after
re-application of power, reset, and start.
21.8.1 Outline of boot swap function
Before erasing the boot program area by self-programming, write a new boot program to the block to be swapped,
and also set the boot flag
Note
. Even if a momentary power failure occurs, the address is swapped when the system is
reset and started next time. Consequently, the above area to be swapped is used as a boot area, and the program is
executed correctly. Figure 21-21 shows an image of the boot swap function.
Note The boot flag is controlled by the flash memory control firmware of the 78K0/KB1+.
Figure 21-21. Image of Boot Swap Function
(1) If boot swap is not supported
User program
User program
User program
Boot program
X X X X H
0 0 0 0 H
User program
User program
User program
Erasure in progress
X X X X H
0 0 0 0 H
User program
User program
User program
Undefined data
X X X X H
0 0 0 0 H
Self-
programming
Momentary
power failure
Not restarted
(2) If boot swap is supported
User program
User program
User program
Boot program
X X X X H
0 0 0 0 H
User program
User program
New boot program
Erasure in progress
X X X X H
0 0 0 0 H
User program
User program
Undefined data
New boot program
X X X X H
0 0 0 0 H
Self-
programming
Momentary
power failure
Started correctly