...
MCUBOOT-based Flashloader
The MCUBOOT-based Flashloader is a specific implementation of the MCU Bootloader. It is used as a one-time programming aid for manufacturing. Most of the MCUBOOT commands are supported in the Flashloader to enable external Flash programming.
See MCU Flashloader Reference Manual for details.
Related Documents:
AN12238 i.MX RT Flashloader Use Case
Elprotronic Host utilities for NXP
...
The SB file is the NXP binary file format for bootable images. The file consists of sections, a sequence of bootloader commands, and data that assists MCU Bootloader in programming the image to target memory. The image data can also be encrypted in the SB file. The file can be downloaded to the target using the MCU Bootloader receive-sb-file command.
...
i.MX RT bootable image
There are two types of supported boot image:
...
XIP (Execute-In-Place) boot image: This type of boot image is only applicable to Serial NOR devices connected to QuadSPI or FlexSPI interfaces and Parallel NOR devices connected to WEIM or SEMC interface. The boot device memory is identical to the destination memory. ROM can boot this boot image directly.
...
To make the manufacturing process easier, all the commands supported by Flashloader and bootable images can be wrapped into a single SB file. Even if there are any changes in the application, Gangflasher-NXP still uses this SB file to manufacture. The SB file can be updated separately without updating Gangflasher-NXP settings.
Related Documents:
MBOOTELFTOSBUG elftosb User's Guide
MCUBLHOSTUG blhost User's Guide
...
i.MX RT bootable image
There are two types of supported boot images:
XIP (Execute-In-Place) boot image: This type of boot image is only applicable to Serial NOR devices connected to QuadSPI or FlexSPI interfaces and Parallel NOR devices connected to WEIM or SEMC interface. The boot device memory is different from identical to the destination memory. ROM loads the boot image from the can boot this boot image directly.
Non-XIP boot image: This type of boot image is usually for the NAND, SD, and eMMC devices that does not support the XIP feature. The boot device memory is different from the destination memory. ROM loads the boot image from the Boot device memory to Destination memory and then boots from the Destination memory
...
Some data structures must be included in the bootable image. The bootable image consists of i.MX RT bootable image:
Image Vector Table (IVT): a list of pointers located at a fixed address that ROM examines to determine where the other components of the bootable image are located.
Boot Data: a table that indicates the bootable image location, image size in bytes, and the plugin flag
Device configuration data (DCD) (optional): IC configuration data, usually is used to configure DDR/SDRAM memory. This is optional
User application and data
CSF (optional): signature block for Secure Boot, generated by CST
KeyBlob (optional) – a data structure consists of wrapped DEK for encrypt boot
...
The Flashloader generates the encrypted XIP image using the AES CTR algorithm when programming the image on the device. On execution, the hardware engine does on-the-fly decryption.
...
The above types of bootable images can be generated by using the elftosb utility. The detailed usage of the elftosb utility is available in elftosb User's Guide.
https://www.nxp.com/docs/en/user-guide/MBOOTELFTOSBUG.pdfMBOOTELFTOSBUG elftosb User's Guide
Expand | ||||
---|---|---|---|---|
| ||||
Typically, the unsigned bootable image is generated and programmed to the destination memory during the development phase. Step 1: Create a BD file. For unsigned image creation, the “constants” block is optional, as shown below.
After the BD file is created, place it into the same folder that holds elftosb utility executable. Step 2: Copy Flashloader.srec provided in the release package into the same folder that holds elftosb utility executable. Step 3: Generate the Bootable image using elftosb utility.
Then, there are two bootable images generated by elftosb utility. The first one is ivt_flashloader_unsigned.bin. The memory regions from 0 to ivt_offset are filled with padding bytes (all 0x00s). |
Expand | ||||
---|---|---|---|---|
| ||||
To generate a signed bootable image using elftosb utility, perform the following steps: Step 1: Create a BD file. The BD file can be as follows
After the blank BD file is created, place it into the same folder that holds elftosb utility executable. Step 2: Copy Flashloader.srec provided in the release package into the same folder that holds elftosb utility executable. Step 3: Copy the “cst” executable, “crts” folder, and “keys” folder from “<cst_installation_dir>” to the same folder that holds elftosb utility executable. Step 4: Generate a bootable image using elftosb utility.
Then, there are two bootable images generated by elftosb utility. The first one is ivt_flashloader_signed.bin. The memory regions from 0 to ivt_offset is filled with padding bytes (all 0x00s). The second one is ivt_flashloader_signed_nopadding.bin, which starts from ivt_offset directly. The CSF section is generated and appended to the unsigned bootable image successfully. |
Generate SB file for bootable image programming
Expand | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
Usually, a BD file for FlexSPI NOR boot consists of 7 parts.
|
Command for secure binary generation:
Code Block |
---|
elftosb -f imx -V -c imx-flexspinor-unsigned.bd -o ivt_flexspinor_xip.bin led_demo_evk_flexspi_nor_0x60002000.srec |
Expand | ||
---|---|---|
| ||
Usually, a BD file for FlexSPI NOR image encryption and programming consists of 7 parts.
|