FlexSPI configuration when Serial Downloader running?

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

FlexSPI configuration when Serial Downloader running?

跳至解决方案
1,214 次查看
GREng
Contributor III

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. 

 

 

标签 (1)
0 项奖励
回复
1 解答
1,146 次查看
diego_charles
NXP TechSupport
NXP TechSupport

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.

diego_charles_0-1714502206666.png

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. 

diego_charles_1-1714502547582.png

Or if you already got an image, you can use test the flash configuration, which will initialize the FlexSPI.

diego_charles_2-1714502633060.png

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

 

 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,147 次查看
diego_charles
NXP TechSupport
NXP TechSupport

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.

diego_charles_0-1714502206666.png

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. 

diego_charles_1-1714502547582.png

Or if you already got an image, you can use test the flash configuration, which will initialize the FlexSPI.

diego_charles_2-1714502633060.png

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

 

 

0 项奖励
回复
1,124 次查看
GREng
Contributor III

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.