Generate SB file for FlexSPI NOR image programming

Generate Normal Bootable Image

For example, in RT1020, the FlexSPI NOR memory starts from address 0x3000_0000 and IVT from offset 0x1000. After following the steps in Section 4.2 (Generate unsigned normal i.MX RT bootable image) and BD file generation, here is the usage of the elftosb utility to create bootable image for FlexSPI NOR. All the BD files are provided in the release package. The figure below refers to the example command to generate a signed image.
Example command to generate signed FlexSPI boot image

After running above command, a file with suffix “_nopadding.bin” is available into destination memory via subsequent SB file based on this binary.

Parent topic:Generate SB file for FlexSPI NOR image programming

Generate SB file for plaintext FlexSPI NOR image programming

Usually, a BD file for FlexSPI NOR boot consists of 7 parts.

  1. The bootable image file path is provided in sources block.

  2. The FlexSPI NOR Configuration Option block is provided in section block.

  3. To enable FlexSPI NOR access, the “enable” command must be used after the option block.

  4. If the flash device is not erased, an “erase” command is required before programming data to the flash device. The erase operation is time consuming and is not required for a blank flash device (factory setting) during manufacturing.

  5. The FlexSPI NOR Configuration Block (FNORCB) is required for FlexSPI NOR boot. To program the FNORCB generated by FlexSPI NOR Configuration Option block, a special magic number ‘0xF000000F” must be loaded into RAM first.

  6. To notify the flashloader to program the FNORCB, an “enable” command must be used after the magic number is loaded.

  7. After the above operation, the flashloader can program the bootable image binary into Serial NOR Flash through FlexSPI module using the load command.

An example containing the above steps is shown in the figure below.
Example BD file for FlexSPI NOR programming

Here is an example to generate SB file using the elftosb utility, ivt_flexspi_nor_xip.bin, and BD file shown in the figure below.
Example command to generate SB file for FlexSPI NOR programming

After the above command, a file named boot_image.sb will be created in the same folder that holds the elftosb utility executable.

Parent topic:Generate SB file for FlexSPI NOR image programming

Generate SB file for FlexSPI NOR Image encryption and programming

Usually, a BD file for FlexSPI NOR image encryption and programming consists of 7 steps.

  1. The bootable image file path is provided in sources block.

  2. Enable FlexSPI NOR access using FlexSPI NOR Configuration Option block.

  3. Erase the flash device if it is not blank. The erase operation is time consuming and is not required for a blank flash device (factory setting) during manufacturing.

  4. Enable image encryption using PRDB option block.

  5. Program FNORCB using magic number.

  6. Program boot image binary into Serial NOR via FlexSPI module.

  7. Enable Encrypted XIP fuse bits.

Example BD file for encrypted FlexSPI NOR image generation and programming The steps to generate SB file is the same as in the above section.

Parent topic:Generate SB file for FlexSPI NOR image programming

Parent topic:Generate SB file for bootable image programming