NOR flash operation from application code on IMXRT platform

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

NOR flash operation from application code on IMXRT platform

1,547 次查看
yash_bhatt1
Contributor III

Hello,

 

We want to implement FOTA feature in IMXRT2021 based board. We have implemented secondary bootloader to suit the purpose. We modify the NOR memory connected over FlexSPI both in bootloader (for message passing) and in Application code (for downloading the image etc). We have used the NOR example code and used it as base for bootloader and have been able to modify the data in NOR flash.

As for the application part, we have ported the functionality from NOR example code to it and we observe that the application code crashes in the Nor_Flash_Initialization() function. We have observed that in the NOR flash example code, the flash operation function were linked to the RAM memory which is not the case when we ported the function to our Application code.

 

Is there a guide on how to or what needs to be taken care of when working on XIP memory read write operation? We are referring to IMXRT1020 Reference manual section 9.13.2 but it does not mention if we need to link the code to ram or how to handle boot loader application type of scenario.

 

Any help is highly appreciated. Thanks!

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

1,248 次查看
simpledeveloper
Contributor III

Hi!
Facing same issue, copied in my project the linkerscripts foldet and files as in the evk_imxrt1060_nor_polling_transfer, even with separated files for operations routines and the running program itself, but everytime the code hits a "FLEXSPI_SoftwareReset(base);", for example into the FLEXSPI_Init, the board reboots.

How this behaviour can be avoided?
The esample code evk_imxrt1060_nor_polling_transfer runs without any problem also with this instruction in it.

0 项奖励
回复

1,528 次查看
victorjimenez
NXP TechSupport
NXP TechSupport

Hello, 

You cannot write, read or erase from the external flash while doing XiP from that same memory. This is why in the example, we moved all the instructions that interact with the memory to the internal RAM. You will need to do the same in your application. 

In the SDK example, we moved everything that's needed to the RAM with the scripts inside the folder linkscripts. To see how this works, you can refer to section 17.15 of the MCUXpresso IDE User Guide. 

Regards,
Victor 

 

0 项奖励
回复