MCUboot for On-Chip OAD (Stack Library)¶
This section describes the behavior of the MCUboot for on-chip OAD where the combined image approach is used. This approach requires two full application and stack library pairs on the target device. In an on-chip OAD system, there are only two image types that can be executed safely:
Persistent application (version 1.0.0): Permanently resident application that implements OAD profile
User application (version higher than): OAD upgradeable application that implements OAD reset service and user functionality
For more information about OAD image header, refer to the MCUboot OAD Image Header section of this chapter. The roles and responsibilities of each application in an on-chip system is defined in the sec-mcuboot-oad-process section.
In summary, the user application is responsible for updating the image version number flash field in the OAD image header, and resetting the device when appropriate; while the persistent application will be resposible of storing the new image.
Based on the image version number field in the image header, MCUboot will decide which image is most fit to run. Figure 29. describes TI’s software solution using MCUboot process.
Figure 29. MCUboot OAD sequence diagram.¶
In order to determine which image is best to run, MCUboot takes the following measures:
At startup, MCUboot checks to identify image header on Primary slot
check magic number (ih_magic) 0x96F3B83D.
Then MCUboot further checks to identify image header on Secondary slot
check magic number (ih_magic) 0x96F3B83D.
Compare versions (ih_ver) and select Primary if Primary version >= Secondary version
MCUboot will now go to certain flash addresses based on the flash layout specified in the
flash_map_backend.h
file in search for a valid Image Identification value. This is done in the following way:Read the version number in the image header, then check for its validity (integrity check, signature verification etc.)
If the image is invalid MCUboot erases its memory slot and starts to validate the other image. After a successful validation of the selected image the bootloader chain-loads it.
Note
Zigbee 3.0 currently supports the Direct XIP and overwrite strategies.