I.MX RT - How to boot to SDRAM

Showing results for 
Show  only  | Search instead for 
Did you mean: 

I.MX RT - How to boot to SDRAM

I.MX RT - How to boot to SDRAM

  1. Introduction

i.MX RT ROM bootloader provides a wealth of options to enable user programs to start in various ways. In some cases, people want to copy application image from Flash or other storage device to SDRAM and run there. In this article, I record three ways to realize this. Section 2 and 3 shows load image from NOR flash. Section 4 shows load image from SD card.

Software and Tools:

MCUXpresso IDE v11.1

NXP-MCUBootUtility 2.2.0


  RT1060 SDK v2.7.0



  1. Add DCD by MCUxpresso IDE

If customers use MCUXpresso to develop the project, they can add DCD head by MCUXpresso.

To show the work flow, we take evkmimxrt1020_iled_blinky as the example.

Step 1: Add the following to Compiler options:



Step 2: Modify the Memory Configuration


Step 3: Select link application to RAM


Step 4. Compile the project. MCUXpresso will generate linker script automatically.

Step 5. Since the code should be linked to RAM, MCUXpresso will not prefix IVT and DCD. We can add these link information to linker script manually. Add below code to .ld file’s head.

    .boot_hdr : ALIGN(4)



        __boot_hdr_start__ = ABSOLUTE(.) ;


        . = 0x1000 ;


        . = 0x1020 ;


        . = 0x1030 ;


        __boot_hdr_end__ = ABSOLUTE(.) ;

        . = 0x2000 ;



Then deselect “Manage linker script” in last screenshot.

Step 6. Recompile the project, IVT/DCD/BOOT_DATA will be add to your project. Then right click the project axf file->Binary Utilities->Create S-record.


After all these step, you can open MCUBootUtility and download the .s19 file to NOR flash.


  1. Add DCD by MCUBootUtility

We can also keep the linker script managed by IDE. MCUBootUtility can add head too. Sometimes it is more flexible than other manners.

Step 1. This time BOARD_SDRAM location should be changed to 0x80002000 while the size should be 0x1cff000. This is because the start 8k space in bootable image is saved for IVT and DCD.

Step 2. compile the project and generate the .s19 file.

Step 3. Open MCUBootUtility. In MCUBootUtility, we should first set the Device Configuration Data. Here I use MIMXRT1060_EVK. So I select the DCD bin file in NXP-MCUBootUtility-2.2.0\src\targets\MIMXRT1062.


After that, select the application image file and click All-in-one Action button. MCUBootUtility can do all the work without any manual operation.


  1. Boot from SD card to SDRAM

In some application, customer don’t want XIP. They want to use SD card to keep application image and run the code in RAM. But if the code size is bigger than OCRAM size, they have to copy image into SDRAM when startup.

With MCUBootUtility’s help, this work is very easy too.  User just need to change the memory map which is located to 0x80001000.


In MCUBootUtility, select the Boot Device to “uSDHC SD” and insert SD card. Then connect the target board. If RT1060 can read the SD card, it will display the SD card information. Then same as last section, set the DCD file and application image file.

Click the All-in-One Action button, MCUBootUtility will generate the bootable image and write it to SD card.


SD card has huge capacity. It's too wasteful to only store boot image. People may ask that can they also create a FAT32 system and store more data file in it? Yes, but you need tool's help. When booting from SD card, ROM code read IVT and DCD from SD card address 0x400. To FAT32, the first 512 bytes in SD is for MBR(MAIN BOOT RECORD). Data in address 0x1c6 in MBR reords the partition start address. If the space from MBR to partition start address is big enough to store boot image, then FAT32 system and boot image can live in peace.




  1.      To help Boot ROM initialize SDRAM, DCD must be placed at right place and indexed by IVT correctly. When our code seems not work, we should first check IVT and DCD.



  1.      The IVT offset from the base address for each boot device type is defined in the table below. The location of the IVT is the only fixed requirement by the ROM. The remainder or the image memory map is flexible and is determined by the contents of the IVT.


Great article. I have followed all along using MCUExpresso IDE and the RT1176 evalkit.

Although when reach step 6, after hand modifying the script, the build operation crashes giving the following errors:



Here the head of my linker script:


 * Copyright (c) 2008-2013 Code Red Technologies Ltd,
 * Copyright 2015, 2018-2019 NXP
 * (c) NXP Semiconductors 2013-2023
 * Generated linker script file for MIMXRT1176xxxxx
 * Created from linkscript.ldt by FMCreateLinkLibraries
 * Using Freemarker v2.3.30
 * MCUXpresso IDE v11.7.1 [Build 9221] [2023-03-28] on Jun 7, 2023, 3:17:55 PM
INCLUDE "evkmimxrt1170_dev_msc_disk_bm_cm7_Debug_library.ld"
INCLUDE "evkmimxrt1170_dev_msc_disk_bm_cm7_Debug_memory.ld"
.boot_hdr : ALIGN(4)
        __boot_hdr_start__ = ABSOLUTE(.) ;
        . = 0x1000 ;
        . = 0x1020 ;
        . = 0x1030 ;
        __boot_hdr_end__ = ABSOLUTE(.) ;
        . = 0x2000 ;
    .text : ALIGN(4)
        __vectors_start__ = ABSOLUTE(.) ;
        /* Global Section Table */
        . = ALIGN(4) ;
And a snapshot of the memories map:



Thanks for your great help!!



No ratings
Version history
Last update:
‎06-06-2023 02:33 AM
Updated by: