How to load MDK RAM app to the RT1170 external flash

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to load MDK RAM app to the RT1170 external flash

How to load MDK RAM app to the RT1170 external flash

How to load MDK RAM app to the RT1170 external flash

1. Abstract

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.

2. App image prepare

2.1 Generate one SDK MDK standalone project

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:

1.jpg

Fig 1


2.jpg

Fig 2

After downloading, we will get the MIMXRT1170-EVK-iled_blinky_cm7.zip, which is the MDK project.

2.2 MDK project image reallocation

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.

3.jpg

Fig 3

ITCM default size is 256K=0X4000, so modify the linker file-> scf file like this:

4.jpgFig 4

Now, to generate the hex and bin image file, which is used for the tool downloading.

5.jpgFig 5

To build the bin file command:

$K\ARM\ARMCC\bin\fromelf.exe --bin --output=debug\@L.bin !L

6.jpgFig 6

  Building, you can find the file in the folder:

MIMXRT1170-EVK-iled_blinky_cm7\iled_blinky_cm7\debug

7.jpgFig 7

2.3 MDK project debug after reallocation

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.

8.jpg

Fig 8

Then build and debug the code, we can find it can enter the ram image debug mode:

9.jpg

Fig 9

3. App image download

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:

10.jpgFig 10

After connection, select the MDK project generated .hex file:

11.jpg

Fig 11

Press the All-in-One-Action button, to download the code, this is the downloaded result:

12.jpg

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.

附件
无评分
版本历史
最后更新:
‎03-04-2024 11:46 PM
更新人: