Renesas FSL-T06 User Manual page 20

Flash self-programming library
Table of Contents

Advertisement

Flash Self-Programming Library
Figure 4-3
R01US0046ED Rev. 1.01
User Manual
Safe Self-Programming without bootloader update
Safe Self-Programming with bootloader update
Safe Self-Programming without bootloader update
The easiest way of safe Self-Programming is to occupy some complete Flash
blocks for the bootloader and do not reprogram them again. By that it never
happens, that an interruption of the reprogramming (e.g. power fail) causes an
invalid bootloader.
Although this method might waste some space if the bootloader does not occupy
a complete Flash block, the handling of reprogramming is easy.
Furthermore, increased safety by protection against reprogramming the
bootloader due to program failures is possible. The block protection feature can
be used to protect the bootloader forever against any reprogramming. In that
case, please consider that the block cannot be reprogrammed in any way any
more.
Safe Self-Programming with bootloader update
Bootloader block update might be necessary due to the following items:
Keep the option to fix bootloader bugs.
Application code/data, that needs to be updated, is stored in the same
block as the bootloader.
If the bootloader has to be updated, it needs to be ensured, that always a
working version of the bootloader is available, even during the update procedure.
Furthermore, in case of a power failure the valid bootloader needs to be detected
and the program has to be started there. To fulfil these requirements, the Boot
Swap functionality is implemented.
Boot swap means, that a certain number of Flash blocks (clusters) can be
swapped in the address range. This swapping is done depending on Boot Swap
bits, set in the Flash Extra Areas. When a valid bootloader is contained in the
corresponding cluster and the swap bit is set accordingly, the block is
automatically swapped to the address 0x00000000 on device start-up. By that
and by the correct reprogramming sequence can be ensured, that even a block
containing a bootloader can be updated safely.
Step 1:
Old
User application
(valid)
Old bootloader
(boot cluster 0)
Unswapped
Step 2:
Old
User application
(invalid)
New bootloader
(boot cluster 1)
Old bootloader
(boot cluster 0)
Swap
Safe bootloader update
Old
User application
(invalid)
Old bootloader
(boot cluster 0)
New bootloader
(boot cluster 1)
FSL Usage
Step 3:
New
User application
(valid)
New bootloader
(boot cluster 1)
Swapped
20

Advertisement

Table of Contents
loading

Table of Contents