IMXRT1064 Flashloader Erase and Program Flash

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

IMXRT1064 Flashloader Erase and Program Flash

跳至解决方案
1,523 次查看
nmeltzer
Contributor II

Hello,

Apologies if this is a duplicate but as far as I could find, nobody has posted specifically about the question I am going to ask. I'll first describe what I am trying to do, then what I have working, and then where things are breaking down.

My Goal:

I have an IMXRT1064 chip acting as a coprocessor to an embedded linux system. There is a desire to use the nxp-provided flashloader/bootloader in order to perform software updates of the IMX chip instead of writing a custom bootloader.

Because tools like sdphost and mcubootutility are windows-programs, I am implementing command line tools for the embedded linux environment that will provide some of the same functionality as the windows-based tools.

The flash that I am trying to write my application to is the "internal" flash that comes on-board the IMXRT1064 chip.

What I have Working:

Using the IMXRT Rom API, I can load the flashloader into RAM and then I can jump to it. After that, I am able to ping the flashloader and get expected responses. I can also use the FillMemory command to fill a given address in RAM with a 32-bit pattern. I verified this by viewing the memory if the RT in a debugger.

Where things are breaking down:

Per both the imxrt and the flashloader reference manuals, I need to configure the flash config block so that the flashloader can talk to the target flash (which makes sense).

In The MCU Flashloader Reference Manual, section 6.2.2.1, the QuadSPI NOR configuration option block is 0xC0000006(100MHz) and in the IMXRT1064 Processor Reference Manual, the configuration block is 0xC0000008(133MHz).

Thus, I use the FillMemory command to fill an address in the DTCM range of RAM (0x20000000 range) with a single iteration of the pattern 0xC0000008(133MHz). I get an ACK and appropriate generic response back from the flashloader.

I then make a call to the ConfigureMemory flashloader api command, and pass it the 2-parameter message that it expects. The first parameter is the SerialNorQuadSPI identifier and the second is the address of the flash config word from above. After sending this command, I do not get any response. No ACK, no generic response ... nothing. I can follow that up with 2 ping commands. The first of which will fail with no response, and the second of which will succeed.

This makes me think that the configure memory command maybe expects more parameters than what the reference manual indicates? but that is just a guess.

Any help will be greatly appreciated! Thank you for your time.

Noah

标签 (1)
标记 (3)
0 项奖励
回复
1 解答
1,513 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @nmeltzer 

  Thanks a lot for your effort!

  From your description, your flashloader already works, just the configure memory area has issues.

This is my previous RT1064 blhost connect command, you can totally refer to it and test it again, whether your configure memory can work or not:

elftosb.exe -f imx -V -c imx-flexspinor-normal-unsigned.bd -o ivt_evkmimxrt1064_iled_blinky.bin evkmimxrt1064_iled_blinky.s19

 

sdphost.exe -t 50000 -p COM41,115200 -j -- write-file 0x20000000 rt1064_ivt_flashloader.bin

 

sdphost.exe -t 50000 -p COM41,115200 -j -- jump-address 0x20000400

 

blhost.exe -t 50000 -p COM41,115200 -j -- get-property 1 0

 

blhost.exe -t 50000 -p COM41,115200 -j -- get-property 24 0

 

blhost.exe -t 5242000 -p COM41,115200 -j -- fill-memory 0x20202000 4 0xc0000007 word

 

blhost.exe -t 5242000 -p COM41,115200 -j -- fill-memory 0x20202004 4 0 word

 

blhost.exe -t 50000 -p COM41,115200 -j -- configure-memory 9 0x20202000

 

blhost -t 5242000 -p COM41,115200 -j -- read-memory 0x70000000 1024 flexspiNorCfg.dat 9

 

blhost -t 2048000 -p COM41,115200 -j -- flash-erase-region 0x70000000 0x6000 9

 

blhost -t 5242000 -p COM41,115200 -j -- fill-memory 0x20203000 4 0XF000000F word

 

blhost -t 50000 -p COM41,115200 -j -- configure-memory 9 0x20203000

 

blhost -t 5242000 -p COM41,115200 -j -- read-memory 0x70000000 1024 flexspiNorCfg.dat 9

 

blhost -t 5242000 -p COM41,115200 -j -- write-memory 0x70001000 ivt_evkmimxrt1064_iled_blinky_nopadding.bin 9

 

blhost -t 5242000 -p COM41,115200 -j -- read-memory 0x70000000 0x6000 flexspiNorCfg.dat 9

 

Any updated information, just let me know.

best Regards,

kerry

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,514 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @nmeltzer 

  Thanks a lot for your effort!

  From your description, your flashloader already works, just the configure memory area has issues.

This is my previous RT1064 blhost connect command, you can totally refer to it and test it again, whether your configure memory can work or not:

elftosb.exe -f imx -V -c imx-flexspinor-normal-unsigned.bd -o ivt_evkmimxrt1064_iled_blinky.bin evkmimxrt1064_iled_blinky.s19

 

sdphost.exe -t 50000 -p COM41,115200 -j -- write-file 0x20000000 rt1064_ivt_flashloader.bin

 

sdphost.exe -t 50000 -p COM41,115200 -j -- jump-address 0x20000400

 

blhost.exe -t 50000 -p COM41,115200 -j -- get-property 1 0

 

blhost.exe -t 50000 -p COM41,115200 -j -- get-property 24 0

 

blhost.exe -t 5242000 -p COM41,115200 -j -- fill-memory 0x20202000 4 0xc0000007 word

 

blhost.exe -t 5242000 -p COM41,115200 -j -- fill-memory 0x20202004 4 0 word

 

blhost.exe -t 50000 -p COM41,115200 -j -- configure-memory 9 0x20202000

 

blhost -t 5242000 -p COM41,115200 -j -- read-memory 0x70000000 1024 flexspiNorCfg.dat 9

 

blhost -t 2048000 -p COM41,115200 -j -- flash-erase-region 0x70000000 0x6000 9

 

blhost -t 5242000 -p COM41,115200 -j -- fill-memory 0x20203000 4 0XF000000F word

 

blhost -t 50000 -p COM41,115200 -j -- configure-memory 9 0x20203000

 

blhost -t 5242000 -p COM41,115200 -j -- read-memory 0x70000000 1024 flexspiNorCfg.dat 9

 

blhost -t 5242000 -p COM41,115200 -j -- write-memory 0x70001000 ivt_evkmimxrt1064_iled_blinky_nopadding.bin 9

 

blhost -t 5242000 -p COM41,115200 -j -- read-memory 0x70000000 0x6000 flexspiNorCfg.dat 9

 

Any updated information, just let me know.

best Regards,

kerry

0 项奖励
回复
1,484 次查看
nmeltzer
Contributor II

Kerry,

Thank you so much. Your message provided enough information to get it working.

0 项奖励
回复