On an i.MX RT1021, with eFuses set for boot from serialNOR flash (BOOT_CFG1[7:4] = 0 ], if it is running in Serial Downloader mode, and I break in with a JTAG debugger, should I be able to see the contents of an attached Serial NOR Flash device on the flexSPI?
I.e. does the bootROM Serial Download application configure the flexSPI correctly to access flash?
Reading the FlexSPI/MCR0 register (@0x402a8000), it reads:0xffff80c2
which makes the MCR0[MDIS] bit = 1, disabling the entire flexSPI interface! I'm unable (via the JTAG debugger) to clear the [MDIS] bit at all.
Memory reads to 0x60000000 (the start of flash) read gibberish; but the MCUExpresso GUI flash tool writes and verifies that there is a FCFB block there.
Solved! Go to Solution.
Hi @GREng
I have verified this on my end. When you boot in serial downloader mode, typically you can't read the contents of the flash memory. Since the ROM bootloader did not initialize the FlexSPI peripheral and it won't since the i.MX RT MCUs are designed to run with many external flash vendors, so it leverages FlexSPI initialization, according to the specific flash, to flashloader.
The below picture shows J-Mem reading garbage from i.MX RT1020 NOR flash at 0x6000_1000, where the IVT resides for a previously programmed XIP image. This reason is because the MCU booted in serial downloader mode and did not initialize FlexSPI.
However, you can read the flash when you originally booted in serial downloader if you load and run an application on RAM and that app enables the FlexSPI peripheral successfully.
Here is an easy way to test this:
Write an image with the MCUXpresso Secure provisioning Tool and then read over SWD flash memory contents. See below picture.
Or if you already got an image, you can use test the flash configuration, which will initialize the FlexSPI.
Basically, what the SPT did here is: tell the bootROM to load the i.MX RT1020 flashloader, then send commads (over BLHOST) to the flashloader to initialize the FlexSPI peripheral.
I hope this could help you.
Diego
Hi @GREng
I have verified this on my end. When you boot in serial downloader mode, typically you can't read the contents of the flash memory. Since the ROM bootloader did not initialize the FlexSPI peripheral and it won't since the i.MX RT MCUs are designed to run with many external flash vendors, so it leverages FlexSPI initialization, according to the specific flash, to flashloader.
The below picture shows J-Mem reading garbage from i.MX RT1020 NOR flash at 0x6000_1000, where the IVT resides for a previously programmed XIP image. This reason is because the MCU booted in serial downloader mode and did not initialize FlexSPI.
However, you can read the flash when you originally booted in serial downloader if you load and run an application on RAM and that app enables the FlexSPI peripheral successfully.
Here is an easy way to test this:
Write an image with the MCUXpresso Secure provisioning Tool and then read over SWD flash memory contents. See below picture.
Or if you already got an image, you can use test the flash configuration, which will initialize the FlexSPI.
Basically, what the SPT did here is: tell the bootROM to load the i.MX RT1020 flashloader, then send commads (over BLHOST) to the flashloader to initialize the FlexSPI peripheral.
I hope this could help you.
Diego
Thank you Deigo. I was also able to find a Kinetis bootloader image and host-PC blhost application to use with it. With the sdphost, I was able to upload the bootloader image into the MCU RAM and use it to look around while the MCU is in Serial Download mode.