The i.MX RT Flashloader is a stand-alone, complete software utility for
developing and manufacturing of the i.MX RT series MCUs. It includes
both the Flashloader binary running in the MCU RAM and the PC-host
tools to communicate with the Flashloader binary. It enables quick and
easy programming of the internal OCOTP (eFuse) and external NOR/NAND/
HyperFlash devices. The host-side command line and GUI tools are available
to communicate with the Flashloader binary via the supported peripherals
(USB-HID or UART).
The Flashloader used for the example in this document is
Flashloader_RT1050_1.1. The hardware platform is the MIMXRT1050EVKB board.
2 i.MX RT1050 Flashloader
2.1 Obtaining the i.MX RT1050 Flashloader
NXP provides the Flashloader package on the official website. Download the
Flashloader package for the i.MX RT1050 MCU and the MIMXRT1050-EVK
board from i.MX RT1050 Evaluation Kit.
NOTE
There are different Flashloader packages for different MCU platforms and they cannot be used interchangeably.
Make sure to download the correct Flashloader package for the specific MCU platform. For the download sites, see
Obtain Flashloader packages.
2.2 Flashloader package
All the files and tools in the Flashloader package work together to achieve these functionalities:
1. Communicate with the MCU BootROM and download the Flashloader image.
2. Create a bootable image (SB file).
NXP Semiconductors
i.MX RT1050 Flashloader
3. Program the MCU internal OCOTP (eFuse) to define the boot mode, MAC address, security mode, and so on.
4. Program the bootable image (SB file) into the MCU external flash (Nor/NAND/HyperFlash/SD).
This is the directory structure of the Flashloader package after it is unzipped:
Table 1 shows detailed information about the Flashloader directories and files.
Table 1. Flashloader directories and files
LA_OPT_Base_License.htm
SW_Content_Register_Kinetis_Bootloader
NXP Software License Agreement
Flashloader release information and software content
.txt
The
doc
directory includes all the documents:
•
i.MX MCU Manufacturing User's Guide.pdf
•
MXRT1050 Flashloader v1.1.0 Release Notes.pdf
doc\
•
Kinetis blhost User's Guide.pdf
•
Kinetis SDPHost User's Guide.pdf
•
MCUX Flashloader Reference Manual.pdf
The
example_images\
Flashloader\
example_images
be used by the Flashloader tools to verify the basic process on the MIMXRT1050EVK board.
The
Flashloader
can be downloaded into the target device and implements the supported features.
directory includes example executable images. They can
directory includes the released Flashloader executable image. It
Table continues on the next page...
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Application Note2 / 23
NXP Semiconductors
Table 1. Flashloader directories and files (continued)
The
Tools\bd_file
Tools\bd_file\
platform. The BD file is the “Boot Description” file. It is used by the elftosb tool to
control the sequence of the bootloader commands present in the final bootable
output file.
The
Tools\blhost
OS host systems.
i.MX RT1050 OCOTP and external flash
directory includes the example BD files for the i.MX RT1050
directory includes the blhost tool for the Windows®/MAC/Linux
Tools\blhost\
Tools\elftosb\
Tools\Mfgtools-rel\
Tools\sdphost\
The blhost application is a command-line utility used by the host computer
to initiate the communication and inject commands to the Flashloader running
on the target device. It can communicate directly with the Flashloader over the
host computer UART (Serial Port) or USB connections and then implement the
programming of the internal eFuse and the external flash device.
The
Tools\elftosb
host systems.
The elftosb tool creates a binary output file that contains the user application image
and a series of bootloader commands. The output is the Secure Binary (SB) file.
The
Tools\Mfgtools-rel
files. The Mfgtool is a GUI application for downloading and programming of
application images into external flash devices.
The
Tools\sdphost
OS host systems. The sdphost tool provides a command line interface for sending
Serial Download Protocol (SDP) commands from the PC host to NXP i.MX devices
in the serial download mode. The sdphost tool is very useful in the factory
programming/manufacturing process. It can be invoked from other applications
and is a very useful tool for testing of automation software, development and test
setups, or manufacturing environments.
directory includes the elftosb tool for the Windows/Linux OS
directory includes the GUI Mfgtool and the configuration
directory includes the sdphost tool for the Windows/MAC/Linux
3 i.MX RT1050 OCOTP and external flash
The key features of the Flashloader are the OCOTP (eFuse) operation and external flash programming. The following subsections
provide a simple introduction to the Flashloader and OCOTP. For more details, see
(document IMXRT1050RM).
3.1 OCOTP (eFuse)
The OCOTP (On-Chip One-Time Programmable) memory, also named eFuse, is a special memory module in the chip. Any eFuse
bit in the field can be programmed from 0 to 1 just once (fused), but the read operation has no limitations. The memory space
contains the whole chip configuration. Here are some key configurations:
• Boot mode
• MAC address
• FlexRAM setting
For the eFuse programming examples using the Flashloader, see Program OCOTP (eFuse).
The eFuse memory space is not assigned to the system 4G address space, so the normal address Read/Write cannot be used
to access the eFuse registers. A specific process is needed to Read/Write the eFuse registers and for the Flashloader to support
this feature.
The OTP memory footprint in Figure 2 shows the registers grouped by the lock region.
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Application Note3 / 23
i.MX RT1050 Processor Reference Manual
NXP Semiconductors
i.MX RT1050 OCOTP and external flash
Figure 2. OTP memory footprint
3.2 External flash
The i.MX RT1050 device provides various external flash memory interfaces:
• 8/16-bit SLC NAND FLASH with the ECC handled by software
• SD/eMMC
• HyperFlash
• Parallel NOR FLASH with XIP support
• Single/dual-channel quad SPI FLASH with XIP support
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Application Note4 / 23
NXP Semiconductors
i.MX RT1050 OCOTP and external flash
The external flash can be used to store the application image and make the i.MX RT1050 boot from the flash image. The
Flashloader includes various flash-programming algorithms to support the flash image programming in the development and
manufacture phases.
3.2.1 Bootable image
For the i.MX RT1050 device, the application image must be stored in the external flash device. It is different for MCUs that have
an internal parallel NOR flash. The internal parallel NOR flash space is assigned to the system 4 G memory space and can be
accessed directly by address. The core can fetch the boot image binary directly and run the eXecute-In-Place (XIP).
After the chip power reset, the BootROM in the i.MX RT1050 always runs first. It checks the boot mode and helps the core to boot
from a specific external flash device.
For various flash interfaces and boot modes, the BootROM must get some additional information from the application image
in the external flash device. By combining the additional necessary information with the application image, you get the final
programmable bootable image.
The additional necessary information are:
• Flash Configuration Block (FCB):
— Optional (used for serial/parallel NOR FLASH).
— Offset: 0x0000.
— Description: The structure of the external flash interface definition.
— Description: The structure includes the address information of the application binary, DCD, BD, and CSF.
• Boot Data (BD):
— Required.
— Offset: 0x0420 (non-XIP)/0x1020 (XIP).
— Description: The structure includes the start address and size of the SB image.
• Device Configuration Data (DCD):
— Optional.
— Offset: Defined in the IVT.
— Description: Currently used to configure the SDRAM (SEMC interface).
• Application binary:
— Required.
— Offset: 0x2000 (Typical).
— Description: The pure application binary.
• Command Sequence File (CSF):
— Optional.
— Offset: Defined in the IVT.
— Description: Used by the High-Assurance Boot (HAB).
• KeyBlob:
— Optional.
— Offset: Defined in the IVT.
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Application Note5 / 23
NXP Semiconductors
i.MX RT1050 OCOTP and external flash
— Description: Secure boot key information.
The elftosb tool in the Flashloader can be used to create the bootable image. The Flashloader also provides some BD example
files. Figure 3 shows the bootable image layout and the function of each block.
Figure 3. Bootable image layout
3.2.2 Booting from external flash
With BootROM, the i.MX RT1050 can boot from various external flash devices in the XIP (NOR-only) or NON-XIP modes. Based
on the IVT and BD information in the Bootable image, the BootROM starts up the application binary directly (XIP) or copies the
bootable image to the RAM and starts up the application binary (NON-XIP).
Figure 4 shows the process of the NON-XIP boot.
• Stage 1: Bootable image is in the external flash.
• Stage 2: BootROM loads the starting 4 KB of data from the bootable image to the internal SRAM (OCRAM). It includes the
IVT and BD information and will be used for the application image loading.
• Stage 3: BootROM transfers the starting 4 KB of data from the internal SRAM (OCRAM) to the destination address space
of the bootable image.
• Stage 4: BootROM continues loading the rest of the bootable image from the external flash to the destination address
space and starts up the application binary.
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Application Note6 / 23
NXP Semiconductors
i.MX RT1050 Flashloader use cases
Figure 4. NON-XIP boot
In stage 2, if the BootROM finds the destination address equal to the external flash address, it will skip the remaining stages and
start up the application binary directly in the flash address space. It is XIP boot.
4 i.MX RT1050 Flashloader use cases
This chapter describes the Flashloader usage case by case and provides the command lines and simple descriptions.
4.1 Target platform environment
All the Flashloader use cases are demonstrated using the MIMXRT1050 EVK target platform, as shown in Figure 5.
For the Flashloader usage, set the configurations as follows:
• Set the Boot Mode Switch (SW7) to 0001b for the serial downloader mode.
• BootROM/Flashloader supports both the OpenSDA/UART and USB-HID ports as the communication interfaces with the
PC host.
• Set the correct Power Supply Switch (J1) based on the communication interfaces used:
— OpenSDA/UART - J1-5&J1-6
— USB-HID - J1-3&J1-4
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Application Note7 / 23
NXP Semiconductors
i.MX RT1050 Flashloader use cases
Figure 5. MIMXRT1050 EVK
When you set the USB-HID as the communication interface with the host PC (Windows OS), the USB-HID device (as shown in
Figure 6) appears in the Windows OS Device Manager.
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Application Note8 / 23
NXP Semiconductors
i.MX RT1050 Flashloader use cases
Figure 6. MIMXRT1050 EVK board USB-HID device
When you set the UART as the communication interface with the host PC (Windows OS), the COM device (as shown in Figure
7) appears in the Windows OS Device Manager.
Figure 7. MIMXRT1050 EVK board UART device
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Application Note9 / 23
NXP Semiconductors
i.MX RT1050 Flashloader use cases
NOTE
The ROM detects the communication over the USB-HID or UART ports and the unused port will be disabled. The
board must be reset to change the communication port used to communicate with the host PC.
4.2 Serial Downloader mode
The BootROM provides the Serial Downloader feature via the UART or USB-HID interfaces, based on the Serial Downloader
Protocol. The main purpose of the Serial Download Protocol is to download bootable images (Flashloader) from the PC (SDPHost
tool) to the device’s internal RAM memory and execute the bootable images in the RAM space. There is a set of commands to read
and write a memory/register unit, get the status of the last command, jump, and execute the image from the provided address.
4.2.1 SDPHost downloads Flashloader image
The BootROM solidified into the i.MX RT chip does not support programming the flash device and the eFuse register. For the
two targets, the Flashloader image is downloaded to the i.MX RT internal RAM using SDPHost (communicates with the running
BootROM) and takes over the device from the BootROM (by the jump-address command of SDPHost). Then it implements the
program process (communicates with the blhost tool).
In addition, the SDPHost jump-address command can start up the image just with the IVT header. Therefore, the
ivt_flashloader.bin
1. Set the MIMXRT1050 EVK board to the Serial Downloader mode and connect the UART/USB-HID interface to the host
PC.
image should be used here.
2. Open the Windows OS Command Prompt and change the directory to
Status (HAB mode) = 1450735702 (0x56787856) HAB disabled.
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Application Note10 / 23
NXP Semiconductors
i.MX RT1050 Flashloader use cases
The USB-HID is re-enumerated by the running Flashloader image. The communication through the USB-HID changes from
the BootROM to the Flashloader running in the internal RAM.
Figure 8. Re-enumerated USB-HID device
6. Verify the communication with a running Flashloader using the blhost tool.
Successful response to command 'read-memory' 5a 00 00 fe (1/1)100% Completed!
Successful generic response to command 'read-memory'
Response status = 0 (0x0) Success.
Response word 1 = 4 (0x4)
Read 4 of 4 bytes.
6. Some key points.
• The eFuse bits can only be programmed from 0 to 1. The OCOTP ignores the writes changing from 1 to 0. For one
eFuse register, the efuse-program-once command can be implemented for a specific bit field in multiple steps.
• The efuse-program-once command includes the eFuse register reload command by default. The latest eFuse
register value can be obtained from a shadow register after the efuse-program-once command.
The elftosb tool creates a binary output file that contains the application image along with a series of Flashloader commands. The
output file is known as an SB file. These files have a
Flashloader commands present in the output file. This command file is called a BD file.
.sb
extension. The tool uses an input command file to control a sequence of
The XIP
hello_world
1. Build the XIP
2. Copy
project for the QSPI NOR flash is used to demonstrate the process of creating a bootable image.
hello_world.out
hello_world.out
to the
file with XIP_BOOT_HEADER_ENABLE=0 and XIP_BOOT_HEADER_DCD_ENABLE=0.
elftosb/win
directory.
Figure 9. Copying
hello_world.out
to
elftosb
3. Open the Windows OS Command Prompt and change the directory
to
) is used to generate the SB file for the QSPI NOR flash.
NOTE
.out
) includes the boot header sections. Make sure the
directory.
Figure 10. Creating
boot_image.sb
4.5 Programming external flash device
For the flash programming, the Flashloader provides an easy-to-use GUI programming tool (Mfgtool).
4.5.1 Mfgtool
The Mfgtool is a GUI tool that helps to program the external flash. It integrates the functionalities of the SDPHost and blhost tools
and can detect an i.MX MCU BootROM connected to the PC host.
These steps show how to program the SB image from Building the bootable image using the Mfgtool.
1. Copy the
2. Change the name under [List] to MXRT105x-DevBoot in the
Application Note15 / 23
boot_image.sb
file to the
<Mfgtool_root_dir>\Profiles\MXRT105X\OS
cfg.ini
file in the
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Firmware folder.
<Mfgtool_root_dir>
directory.
NXP Semiconductors
i.MX RT1050 Flashloader use cases
Figure 11. Setting the name of the LIST item
3. Set the MIMXRT1050-EVK board to the Serial Downloader mode and connect the USB-HID interface to the host PC.
4. Open the Mfgtool and connect to the MIMXRT1050-EVK board.
Figure 12. Connect with MIMXRT1050 EVK
5. Program the bootable image. Click the Start button to trigger a programming sequence and wait for it to complete, as shown
in Figure 13. To exit Mfgtool, click the Stop and Exit buttons.
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Application Note16 / 23
NXP Semiconductors
i.MX RT1050 Flashloader use cases
Figure 13. Programing the flash successfully
6. Switch the MIMXRT1050-EVK board to a correct boot mode for the programmed SB image and verify the application.
For more information about building the bootable image and programming the external flash, see
SPI Flash and SD Card
(document AN12107) and
How to Enable Boot from QSPI Flash
How to Enable Boot from Octal
(document AN12108).
4.5.2 blhost
The blhost application is a command-line utility used on the host computer to initiate communication and issue commands to
the MCU bootloader (Flashloader). The application only sends one command per invocation. It can communicate directly with the
Flashloader over the host computer UART (Serial Port) or USB connections and then implement the programming of the external
flash device. It is also available under the Downloads tab at MCUBOOT.
Example programming SB file via USB connection.
>blhost.exe -u -- receive-sb-file boot_image.sb
Inject command 'receive-sb-file'
Preparing to send 22208 (0x56c0) bytes to the target.
Successful generic response to command 'receive-sb-file'
(1/1)100% Completed!
Successful generic response to command 'receive-sb-file'
Response status = 0 (0x0) Success.
Wrote 22208 of 22208 bytes.
The blhost can also support to program the binary (not SB file) step by step.
1. The config parameter should be stored in RAM, which will be used in configuring the FlexSPI in next step. The config
parameter is selected according to the FLASH type. Different NOR flash need different config parameters to enable and
program. For more information, see FlexSPI configuration options and memory ID.
2. Use the config parameter stored in RAM in previous step to config the FlexSPI. Then, you can read, erase, and program
the flash. The value 0x9 in the command line indicates the memory ID. For more information, see FlexSPI configuration
options and memory ID.
>blhost.exe -u -- configure-memory 0x9 0x2000
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Application Note17 / 23
NXP Semiconductors
i.MX RT10xx Flashloader
3. Program the raw binary using -- flash-erase-region and -- write-memory commands, or program the formatted image
using -- flash-image by memory ID.
This chapter provide more Flashloader information of other RT10xx platforms.
5.1 Obtain Flashloader packages
• i.MX RT1010
There is no standalone Flashloader package for i.MX RT1010. Please obtain the SDK including the mcu-boot middleware
and find the Flashloader elements in
• i.MX RT1015
There is no standalone Flashloader package for i.MX RT1015. Please obtain the SDK including the mcu-boot middleware
and find the Flashloader elements in
• i.MX RT1020
Please find the Flashloader package on i.MX RT1020 Crossover MCU with Arm® Cortex®-M7 core
<SDK ROOT>\middleware\mcu-boot
<SDK ROOT>\middleware\mcu-boot
.
.
• i.MX RT1050
Please find the Flashloader package on i.MX RT1050 Crossover MCU with Arm® Cortex®-M7 core
• i.MX RT1060
Please find the Flashloader package on i.MX RT1060 Crossover MCU with Arm® Cortex®-M7 core
NOTE
For RT1020, RT1050 and RT1060, the latest SDKs also include Flashloader elements in
ROOT>\middleware\mcu-boot
of SDK may not have the mcu-boot module.
if selecting the mcu-boot module in SDK builder page. But the older version
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Application Note18 / 23
NXP Semiconductors
i.MX RT10xx Flashloader
ivt_flashloader.bin
load address and jump address can be derived by decoding the ivt header of the
ivt_flashloader.bin
file from
the SDK. The ivt header is typically located at offset 0x000 or 0x400 and the first word is 0x402000d1. The jump address is at
offset 0x14 from the start of the ivt header. The load address for the spdhost write-file command is the jump address minus any
padding in the binary file before ivt header (0x000 or 0x400). The jump address is the address that needs to be used for the
spdhost jump-address command.
shows an example from i.MX RT1060
ivt_flashloader.bin
binary.
• ivt first word 0x402000d1 is at 0x00000400.
• The jump address is 0x20000400 at ivt head offset 0x14.
• The load address is 0x20000400 – 0x00000400 = 0x20000000.
Figure 14. Example from i.MX RT1060 ivt_flashloader.bin binary
And the load address/jump address for different i.MX RT10xx platform can be found in the list:
Example loading flashloader from SDK for RT1010:
>sdphost.exe -u 0x1fc9,0x0145 -V -- write-file 0x20205800 "<path to flashloader>\ivt_flashloader.bin"
5. Power down RT1010 and switch to Internal Boot mode.
BOOT_MODE[1:0]=10
6. Power on RT1010.
6 Conclusion
This application note describes the background knowledge of the Flashloader and the use cases of the Flashloader. For more
information, see these documents:
•
i.MX MCU Manufacturing User's Guide.pdf
•
Kinetis blhost User's Guide.pdf
•
Kinetis SDPHost User's Guide.pdf
•
MCUX Flashloader Reference Manual.pdf
7 Revision history
Table 3. Revision history
Revision numberDateSubstantive changes
008/2018Initial release.
109/2018Fixed errors in Program FlexRAM eFuse.
202/2021Added blhost, and FlexSPI configuration options and memory ID.
A FlexSPI configuration options and memory ID
The source code for the flashloader is provided as an example in the SDK:
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Application Note21 / 23
NXP Semiconductors
kFlexSpiSerialClk_133MHz = 7,
kFlexSpiSerialClk_166MHz = 8,
kFlexSpiSerialClk_200MHz = 9,
};
Table 4 shows the memory ID definitions for -- configure-memory command.
Table 4. Memory ID definitions for -- configure-memory command
Internal memoryDevice internal memory space
0Internal memory (Default selected mmory)
16 (0 × 10)Execute-only region on internal flash (only used for flash-erase-all)
The memories that are remapped to internal space, and must be accessed by internal
Mapped external memory
addresses. (IDs in this group are only used for flash-erase-all and configure-memory,
and ignored by write-memory, read-memory, flash-erase-region and flash-image (use
default 0))
1QuadSPI memory
8SEMC NOR memory
9FlexSPI NOR memory
FlexSPI configuration options and memory ID
10 (0xa)SPIFI NOR memory
Memories which cannot be remapped to internal spance, and only can be accessed
Unmapped external memory
by memories' addresses. (Must be spencified for all commends with <memoryID>
argument)
256 (0 × 100)SEMC NAND memory
257 (0 × 101)SPI NAND memory
272 (0 × 110)SPI NOR/EEPROM memory
273 (0 × 111)I2C NOR/EEPROM memory
288 (0 × 120)uSDHC SD memory
289 (0 × 121)uSDHC MMC memory
i.MX RT Flashloader Use Case, Rev. 2, February 4, 2021
Application Note22 / 23
How To Reach Us
Home Page:
nxp.com
Web Support:
nxp.com/support
Information in this document is provided solely to enable system and software implementers to use NXP products. There
are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits based on the
information in this document. NXP reserves the right to make changes without further notice to any products herein.
NXP makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor
does NXP assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any
and all liability, including without limitation consequential or incidental damages. “Typical” parameters that may be provided
in NXP data sheets and/or specifications can and do vary in different applications, and actual performance may vary over
time. All operating parameters, including “typicals,” must be validated for each customer application by customer's technical
experts. NXP does not convey any license under its patent rights nor the rights of others. NXP sells products pursuant to
standard terms and conditions of sale, which can be found at the following address: nxp.com/SalesTermsandConditions.
Right to make changes - NXP Semiconductors reserves the right to make changes to information published in this
document, including without limitation specifications and product descriptions, at any time and without notice. This
document supersedes and replaces all information supplied prior to the publication hereof.
Security — Customer understands that all NXP products may be subject to unidentified or documented vulnerabilities.
Customer is responsible for the design and operation of its applications and products throughout their lifecycles to reduce
the effect of these vulnerabilities on customer’s applications and products. Customer’s responsibility also extends to other
open and/or proprietary technologies supported by NXP products for use in customer’s applications. NXP accepts no
liability for any vulnerability. Customer should regularly check security updates from NXP and follow up appropriately.
Customer shall select products with security features that best meet rules, regulations, and standards of the intended
application and make the ultimate design decisions regarding its products and is solely responsible for compliance with all
legal, regulatory, and security related requirements concerning its products, regardless of any information or support that
may be provided by NXP. NXP has a Product Security Incident Response Team (PSIRT) (reachable at PSIRT@nxp.com)
that manages the investigation, reporting, and solution release to security vulnerabilities of NXP products.
NXP, the NXP logo, NXP SECURE CONNECTIONS FOR A SMARTER WORLD, COOLFLUX,EMBRACE, GREENCHIP,