MCU Boot how to get it running on the MIMXRT1020 without being in serial mode?

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

MCU Boot how to get it running on the MIMXRT1020 without being in serial mode?

1,140 次查看
anonomous_programmer
Contributor II

I am trying to get the MIMXRT1020 running the flashloader program from the SDK on Keil. Ultimately, I would like to modify this program to accept commands and data from the SPI pins instead of UART or USB on the MIMXRT1024. The Arm Keil pack for the MIMXRT1024 has not been released yet so I will be working with the 1020 first. To reach this goal, I envision breaking this task into smaller tasks outlined below:

  • Run flashloader from address 0x60002400
  • Flash the blink project to MCU and launch it via USB
  • Repeat flashing the blink project but using UART via FTDI chip (already got UART working)
  • Add code to copy flashloader to RAM and initialize it identically to the scatter file provided. Specifically, interrupts from 0x2020a000-0x2020a400, program code from 0x2020a800-0x2022000, and stack from 0x20000000-0x20010000 growing down.
  • Using MCU-Boot for another NXP MCU as a reference, initialize SPI_1 and verify proper functionality.

When I set the pins on SW8[3:4] to 0 and 1 and plug in the EVK board, I am able to see the board on usb using the NXP-MCU Boot Utility 3.1.0 obtained from https://github.com/JayHeng/NXP-MCUBootUtility 

Looking at the scatter file for the MIMXRT1020 flashloader program, I see that the program is getting copied into RAM and executed from RAM instead of copied into flash then to ram after reset before executing.

I have checked the SDK for examples for the 1020, 1024 and 1052. All three seem to be directly loaded to ram in the example. Also, the 1052 is listed on https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuboot-mcu-... as having SPI detection but sadly after looking through the code I was unable to find SPI being initialized or used.

I also found this for moving my code: https://stackoverflow.com/questions/62266941/relocation-of-data-from-flash-to-ram-during-boot-phase . The concept seems simple enough but I know implementing it for the first time may be a bit of a hurdle. 

I am also planning on devoting more time to read the ARM linker document and see what gotchas apply when using Keil.

Does anyone know of any NXP MCU Bootloader examples that hopefully run from internal/external flash and/or use SPI as a peripheral? That and hopefully a suggestion where to focus my attention to read to better learn how to utilize this example.

标签 (2)
0 项奖励
回复
0 回复数