OTA update by using SB3 file#
The secure binary (SB) container in version 3.1 (SB3 for short) provides an alternative way to encapsulate an OTA image. This format offers a secure and easy way to utilize hardware security features of a device to safely transport an OTA update, regardless of the security of the transport channel.
In the MCUXpresso OTA examples, there are two ways of using SB3:
The ROM bootloader using the dual-image feature
The process is demonstrated in the
ota_rom_basicexample.Flash memory is divided into two equal regions for images.
Based on the image version, the ROM bootloader disables or enables the flash remapping feature and jumps to the application.
SB3 used to encapsulate the MCUboot image and secure its transport
The process is demonstrated in the
ota_mcuboot_basicexample.The example provides an additional command,
xmodem_sb3, to receive and process the SB3 file.The flash remapping feature is driven by MCUboot.
OTA using SB3 and flash remapping functionality#
The flash remapping feature, if supported, is enabled by default in the examples. However, there are a few things to keep in mind when using SB3 for an OTA update.
A user has to ensure that the SB3 processed by an application has the correct load address, targeting the currently inactive image region, because the active application has no control over the ROM IAP that handles the SB3. This creates a risk of overwriting the active image region, potentially leading to a bricked device if an incorrect SB3 is downloaded and no backup image is present in the inactive image region to recover from. This applies to both the MCUboot and the ROM bootloader use cases.
In other words, if flash remap based on OVERLAY is used, two separate SB3 files (one for the first and one for the second image region) have to be prepared. The application has to distinguish between these two binaries during an OTA update.
In the case of flash remap based on the SWAP mechanism, the SB3 file must always be generated for the second image region. Due to the design of SWAP, the SB3 payload is always written to the inactive image region.
For more information, please read ‘Flash remapping functionality’.