Skip to main content

Standalone download

This section describes how to download an application to the iMX RT board without using the IDE. Note that this section does not describe how to create the application code (create the application, compile and link it). It is assumed that a binary file exist that represent the application program.

As a reminder, there are two basic methods for program download.

  • ISP over USB Program Download ISP is short for In-System Programming. The i.MX RT MCU contains a bootloader in ROM that can be enabled by pressing the ISP Enable push-button.

    An application (MCUXpresso Secure Provisioning Tools) provided by NXP is needed on the PC for downloading and flashing the application code. It is this method that will be described in this chapter.

    • This method of programming is useful during production
    • The MCUXpresso Secure Provisioning Tools application is needed to generate an authenticated or encrypted image of the application.
    • Technically it is possible to program/flash without a JTAG probe (via NXP's MCUXpresso Secure Provisioning Tools application), but it is strongly recommended to use the proper tool for debugging - i.e., use a JTAG probe!
  • SWD/JTAG Debug Interface Using this method, the application can be downloaded to internal SRAM, to external SDRAM or external flash.

    This method is tightly integrated with the Integrated Development Environment (IDE) used. Specific scripts (and sometimes flash programming algorithms) must exist for the used IDE. Currently such scripts and drivers exist for Keil uVision/MDK, NXP MCUXpresso and IAR Embedded Workbench. For other IDEs, check supported functions.

    • There are many different SWD/JTAG interfaces on the market. NXP has created the low-cost MCU-Link and LPC-LINK2, Keil has ULINK2/ULINKpro, Segger has J-LINK, etc.

Install the Required Software

Download MCUXpresso Secure Provisioning Tools from NXP's website. It can be found under the Tools & Software tab for each MCU or directly here. The tool is available for Windows, MacOS and Linux but this document only covers the Windows use case. Patching and using the MacOS and Linux versions should be very similar with only paths and file names varying.

The default installation location is c:\nxp\MCUX_Provi_v2.1\ which will be referred to as <install directory> from now on.

Prepare the Program to Flash

A program can be setup to run directly in external nor flash, in internal SRAM or in (external) SDRAM and the project must be modified accordingly. This is described in detail in section 7.2 RT10xx/RT11xx Device Workflow of the User Manual - MCUXpresso Secure Provisioning Tools that comes with the installation of the tool (filename: MCUXpresso Secure Provisioning Tools.pdf) or it can be viewed here: https://www.nxp.com/docs/en/user-guide/MCUXSPTUG.pdf

As an example, this is what was needed to prepare the led_blinky demo application.

  1. Open the project <install_dir>\eaimxrt1176_sdk_2_10_1\boards\evkmimxrt1170\demo_apps\led_blinky\cm7\mdk\iled_blinky_cm7.uvprojx

  2. Select the sdram_debug target

  3. Open Project Options Output and make sure that Create HEX File is selected

  4. Switch to the Linker tab and click Edit to open the scatter file in the background

  5. Close the dialog with the OK button (to save the change made in step 3)

  6. Modify the following lines in the scatter file:

    #define m_interrupts_start             0x00000000
    #define m_interrupts_size 0x00000400

    #define m_text_start 0x00000400
    #define m_text_size 0x0003FC00

    #define m_data_start 0x80000000
    #define m_data_size 0x01000000

    to look like this:

    #define m_interrupts_start             0x80002000
    #define m_interrupts_size 0x00000400

    #define m_text_start 0x80002400
    #define m_text_size 0x0001DC00

    #define m_data_start 0x80020000
    #define m_data_size 0x00DE0000
  7. Save the file

  8. Press F7 or Project Build Target

  9. There should now be a hex file here: <install_dir>\eaimxrt1176_sdk_2_10_1\boards\evkmimxrt1170\demo_apps\led_blinky\cm7\mdk\sdram_debug\iled_blinky_cm7.hex

Booting an Unsigned Image

Unsigned image is typically used for development. It's recommended to start with this boot type before working with secured images to verify that the executable image works properly.

The first step is to convert the prepared application into a bootable image.

  1. Start with a new workspace, File New Workspace...

    Secure Provisioning - New workspace

  2. Select a location for the workspace and which processor to use. Click Create.

  3. Make sure that Boot Type is Unsigned

  4. Set Boot Device to flex-spi-nor/IS25LPxxxA_IS25WPxxxA for iMX RT11xx targets. For the iMX RT1064 set the Boot Device to flex-spi-nor/W25Q32JV.

  5. Switch to the Build Image tab

  6. Select the Source executable image that was prepared in the previous section, i.e. iled_blinky_cm7.hex

  7. If (and only if) the application uses SDRAM, select the Use custom DCD option and point to the dcd_sdram.bin file from the <install directory>\bin\data\targets\mimxrt*\ folder

  8. Click Build Image

    Secure provisioning - Build image

To write the image:

  1. Switch to the Write Image tab

  2. Make sure that the Use built image option is selected

  3. Connect the hardware to the PC using micro-B to A USB cables in both J26 and J29 connectors

  4. Put the hardware in ISP mode:

    1. Push and hold down the ISP enable button
    2. Press the Reset button
    3. Release the Reset button
    4. Wait 1 seconds
    5. Release the ISP enable button
  5. Press the Write Image button

  6. When finished, press the Reset button on the hardware to run the program

    Secure Provisioning - Write image

Booting an Authenticated or Encrypted Image

The MCUXpresso Secure Provisioning Tools support authenticated (signed) and encrypted (signed+encrypted) images. This is described in detail in the User Manual for the tool. A couple of very important notes:

  1. Encrypted images cannot be used for applications that execute directly in the flash (XiP).
  2. Burning the fuses in the processor is an irreversible operation. If the fuses are burnt and the key is lost, then there is no way to burn anything again on that hardware so make sure to backup the (generated) keys BEFORE burning them to the hardware.
  3. If the instructions mention setting the SW7 DIP to the board to 0001 it means putting the board into ISP mode. This is done on the Developers Kit by:
    1. Push and hold down the ISP enable button
    2. Press the Reset button
    3. Release the Reset button
    4. Wait 1 seconds
    5. Release the ISP enable button