i.MX RT Manufacturing Guide
i.MX RT Boot ROM
The i.MX RT Boot ROM is a standard bootloader for all i.MX RT devices.
Supports booting from external flash devices for both XIP and non-XIP boot cases.
Provides serial downloader feature via UART or USB-HID interface into the internal RAM of i.MX RT devices.
The i.MX RT Boot ROM is a specific implementation of the existing i.MX MPU ROM Bootloader.
For Flash programming use case, the i.MX RT Boot ROM provides a serial downloader feature powered by SDP command interface.
The Gangflasher-NXP downloads the MCUBOOT-based Flashloader into internal SRAM and jumps to the Flashloader to enable Flash programming features.
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 Gangflasher-NXP is a GUI host program used to interface with devices running i.MX RT Boot ROM under serial downloader mode. It can also be used to program an application image by interfacing with the Flashloader.
The Gangflasher-NXP-CLI is a command-line host program used to interface with devices running MCUBOOT-based bootloaders.
Gangflasher-NXP.dll is API for custom application ..
Secure Binary File
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.
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 identical to the destination memory. ROM 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
Boot image format
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
Each bootable image starts with an appropriate IVT. In general, for the external memory devices that support XIP feature, the IVT offset is 0x1000 else it is 0x400. For example, for FlexSPI NOR on RT1060, the IVT must start at address 0x60001000 (start address is 0x6000_0000, IVT offset is 0x1000). Refer to the corresponding Processor Reference Manual for additional information.
Image Vector Table (IVT)
Offset | Size (Bytes) | Field | Description |
---|---|---|---|
0x00 | 4 | header |
|
0x04 | 4 | entry | Absolute address of the first instruction to execute from the image, or the vector address of the image |
0x08 | 4 | reserved1 | Reserved for future use, set to 0 |
0x0C | 4 | dcd | Absolute address of the image DCD. It is optional, so this field can be set o NULL if no DCD is required. |
0x10 | 4 | boot_data | Absolute address of the boot data |
0x14 | 4 | self | Absolute address of the IVT. |
0x18 | 4 | csf | Absolute address of the Command Sequence File (CSF) used by the HAB library |
0x1C | 4 | reserved2 | Reserved, set to 0 |
Boot Data
Offset | Size (Bytes) | Field | Description |
---|---|---|---|
0x00 | 4 | start | Absolute address of the bootable image |
0x04 | 4 | length | Size of the bootable image |
0x08 | 4 | plugin | Plugin flag, set to 0 if it is a normal boot image |
Signed image
The bootable image can be signed by CST tool. The tool generates the CSF data in the binary file format that consists of command sequences and signatures based on a given input command sequence file (csf file). Refer to the documentation in the CST release package for further details.
Encrypted image
There are two types of encrypted image formats:
Encrypted XIP image format
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.
Encrypted image generated by CST
To increase the security level, the bootable image can be signed and further encrypted by the CST. The KeyBlob must be generated on the device. The hardware deletes all sensitive keys if any security violation happens, so the sensitive keys cannot be cloned.
Generate i.MX RT bootable image
There are two types of bootable images for i.MX RT devices.
Normal boot image: This type of image can boot directly by boot ROM.
Plugin boot image: This type of image can be used to load a boot image from devices that are not natively supported by boot ROM.
Both types of images can be unsigned, signed, and encrypted for different production phases and different security level requirements:
Unsigned Image: The image does not contain authentication-related data and is used during the development phase.
Signed Image: The image contains authentication-related data (CSF section) and is used during the production phase.
Encrypted Image: The image contains encrypted application data and authentication-related data and is used during the production phase with the higher security requirements.
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.
MBOOTELFTOSBUG elftosb User's Guide
Generate SB file for bootable image programming
Command for secure binary generation: