This guide is requested by our end customer, he wants to realize the MDK project RAM code download to the MIMXRT1170 external QSPI flash. So, based on the NXP RT1170 SDK, and the MIMXRT1170-EVK board, generate the MDK project, reallocate the app image, generate the image, and use the tool to download the code to the external flash.
Open the SDK_2_15_000_MIMXRT1170-EVK webpage:
https://mcuxpresso.nxp.com/en/builder?hw=MIMXRT1170-EVK
Download the SDK, and generate one MDK standalone project:
Fig 1
Fig 2
After downloading, we will get the MIMXRT1170-EVK-iled_blinky_cm7.zip, which is the MDK project.
As the RAM image is the none-xip image, normally to the IDE, can’t download to the flash directly, as the debug is in the RAM. If want to download to the flash, we can generate the app image, then use the tool to program it to the external flash. Normally, none-xip image, the IVT offset is 0X400, so we need to reallocate the image start address, here, we can use 0X2000 as the app entry address.
Fig 3
ITCM default size is 256K=0X4000, so modify the linker file-> scf file like this:
Fig 4
Now, to generate the hex and bin image file, which is used for the tool downloading.
Fig 5
To build the bin file command:
$K\ARM\ARMCC\bin\fromelf.exe --bin --output=debug\@L.bin !L
Fig 6
Building, you can find the file in the folder:
MIMXRT1170-EVK-iled_blinky_cm7\iled_blinky_cm7\debug
Fig 7
After the image reallocation, some customer may still need the MDK RAM project can do the debugging, here, also need to modify the debug .ini file. The Setup also need to change the SP, PC and Vector table offset register address.
Fig 8
Then build and debug the code, we can find it can enter the ram image debug mode:
Fig 9
We can use the MCUBootUtility Tool to download the code:
https://github.com/JayHeng/NXP-MCUBootUtility/releases/tag/v6.1.0
the related user manual is:
https://github.com/JayHeng/NXP-MCUBootUtility
Download the tool.
MIMXRT1170-EVK enter the serial download mode by changing SW1:
1-OFF,2-OFF,3-OFF,4-ON
Power off and power on the board again, find another USB cable to connect the J20 USB1 interface.
Then, use the MCUBootutility to connect the board:
Fig 10
After connection, select the MDK project generated .hex file:
Fig 11
Press the All-in-One-Action button, to download the code, this is the downloaded result:
Fig 12
Press the “Reset device” button to exit the tool.
Then MIMXRT1170-EVK board change SW1:
1-OFF, 2-OFF, 3-ON,4-OFF
Press the EVK on board reset button, SW4, you will find the LED is blinking, it means the MDK RAM project already download to the external QSPI flash, and boot OK.