CHAPTER 26 FLASH MEMORYUser’s Manual U16899EJ2V0UD45226.9 Boot Swap FunctionThe 78K0/KE1+ 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 afterre-application of power, reset, and start.26.9.1 Outline of boot swap functionBefore erasing the boot program area by self-programming, write a new boot program to the block to be swapped,and also set the boot flagNote. Even if a momentary power failure occurs, the address is swapped when the system isreset and started next time. Consequently, the above area to be swapped is used as a boot area, and the program isexecuted correctly. Figure 26-22 shows an image of the boot swap function.Note The boot flag is controlled by the flash memory control firmware of the 78K0/KE1+.Figure 26-22. Image of Boot Swap Function(1) If boot swap is not supportedUser programUser programUser programBoot programX X X X H0 0 0 0 HUser programUser programUser programErasure in progressX X X X H0 0 0 0 HUser programUser programUser programUndefined dataX X X X H0 0 0 0 HSelf-programmingMomentarypower failureNot restarted(2) If boot swap is supportedUser programUser programUser programBoot programX X X X H0 0 0 0 HUser programUser programNew boot programErasure in progressX X X X H0 0 0 0 HUser programUser programUndefined dataNew boot programX X X X H0 0 0 0 HSelf-programmingMomentarypower failureStarted correctly