Create i.MX RT bootable image
Create image using KSDK XIP example
Users can create an unsigned bootable image by building a KSDK XIP project and convert the output to a binary file. The binary file needs to be renamed to the boot_image.bin and copied to the same folder as ucl2.xml. Then users can update the cfg.ini file to enable an option of manufacturing flow which is described in previous section.
Parent topic:Create i.MX RT bootable image
Create image using the elftosb utility
To create a bootable image for a specific memory, users need to know the memory map of i.MX RT117x SoC. Details of generating bootable image can be found in Chapter 4. Here are the steps to create an i.MX RT bootable image for FlexSPI NOR using elftosb utility.
Create the BD file for boot image generation. The BD file content is showed below. It is also available in the release package in “<sdk_package>/middleware/mcu-boot/bin/Tools/bd_file/imxrt117xfolder
options {
flags = 0x00;
startAddress = 0x30000000;
ivtOffset = 0x1000;
initialLoadSize = 0x2000;
}
entryPointAddress = 0x30002000;
sources {
elfFile = extern(0);
}
section (0)
{
}
Create the i.MX RT bootable image using elftosb utility.
Here is the example command:
Example command to generate FlexSPI NOR boot image
ivt_flexspi_nor_xip.bin
ivt_flexspi_nor_xip_nopadding.bin
The ivt_flexspi_nor_xip_nopadding.bin will be used to generate SB file for QSPI FLASH programming in subsequent section.
Parent topic:Create i.MX RT bootable image
Create SB file for QSPI FLASH programming
Here is an example to create an SB file for QSPI FLASH programming for RT1170-EVK board. The details for generating SB file for bootable image programming is available in Chapter 5.
# The source block assign file name to identifiers
sources {
myBinFile = extern (0);
}
constants {
kAbsAddr_Start= 0x30000000;
kAbsAddr_Ivt = 0x30001000;
kAbsAddr_App = 0x30002000;
}
# The section block specifies the sequence of boot commands to
# be written to the SB file
section (0) {
#1. Prepare Flash option
# 0xc0000007 is the tag for Serial NOR parameter selection
# bit [31:28] Tag fixed to 0x0C
# bit [27:24] Option size fixed to 0
# bit [23:20] Flash type option
# 0 - QuadSPI SDR NOR
# 1 - QUadSPI DDR NOR
# bit [19:16] Query pads (Pads used for query Flash Parameters)
# 0 - 1
# bit [15:12] CMD pads (Pads used for query Flash Parameters)
# 0 - 1
# bit [11: 08] Quad Mode Entry Setting
# 0 - Not Configured, apply to devices:
# - With Quad Mode enabled by default or
# - Compliant with JESD216A/B or later revision
# 1 - Set bit 6 in Status Register 1
# 2 - Set bit 1 in Status Register 2
# 3 - Set bit 7 in Status Register 2
# 4 - Set bit 1 in Status Register 2 by 0x31 command
# bit [07: 04] Misc. control field
# 3 - Data Order swapped, used for Macronix OctaFLASH devcies only
# (except MX25UM51345G)
# 4 - Second QSPI NOR Pinmux
# bit [03: 00] Flash Frequency, device specific
load 0xc0000006 > 0x2000;
# Configure QSPI NOR FLASH using option a address 0x2000
enable flexspinor 0x2000;
#2 Erase flash as needed.
#(Here only 64KBytes are erased, need to be adjusted to the actual
#size of users' application)
erase 0x 30000000..0x30040000
;
#3. Program config block
# 0xf000000f is the tag to notify Flashloader to program
# FlexSPI NOR config block to the start of device
load 0xf000000f > 0x3000;
# Notify Flashloader to response the option at address 0x3000
enable flexspinor 0x3000;
#4. Program image
load myBinFile > kAbsAddr_Ivt;
}
After the BD file is ready, the next step is to generate the boot_image.sb file that is for MfgTool to use later. Here is the example command:
Example command to generate SB file for FlexSPI NOR programming
After using the above command, the boot_image.sb is generated in the elftosb utility folder.
Parent topic:Create i.MX RT bootable image
Parent topic:Manufacturing process in Development phase