NEC 78K0 Series User Manual page 576

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0 Series:
Table of Contents

Advertisement

26.9.1 Boot swap function
If rewriting the boot area has failed during self-programming due to a power failure or some other cause, the data
in the boot area may be lost and the program may not be restarted by resetting.
The boot swap function is used to avoid this problem.
Before erasing boot cluster 0
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 78K0/KE2, 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.
If the program has been correctly written to boot cluster 0, restore the original boot area by using the set
information function of the firmware of the 78K0/KE2.
Note A boot cluster is a 4 KB area and boot clusters 0 and 1 are swapped by the boot swap function.
Boot cluster 0 (0000H to 0FFFH): Original boot program area
Boot cluster 1 (1000H to 1FFFH): Area subject to boot swap function
X X X X H
User program
2 0 0 0 H
User program
1 0 0 0 H
Boot program
(boot cluster 0)
0 0 0 0 H
576
CHAPTER 26 FLASH MEMORY
Note
, which is a boot program area, by self-programming, write a new boot program to
Figure 26-17. Boot Swap Function
Self-programming
User program
to boot cluster 1
New boot program
(boot cluster 1)
Boot program
(boot cluster 0)
Boot
X X X X H
Self-programming
User program
to boot cluster 0
2 0 0 0 H
New boot program
(boot cluster 1)
1 0 0 0 H
New boot program
(boot cluster 0)
0 0 0 0 H
Preliminary User's Manual U17260EJ3V1UD
Execution of boot
User program
swap by firmware
New boot program
(boot cluster 1)
Boot
Boot program
(boot cluster 0)
Execution of boot
User program
swap by firmware
New boot program
(boot cluster 1)
Boot
New boot program
(boot cluster 0)
Boot
Boot

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents