NOR flash operation from application code on IMXRT platform

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NOR flash operation from application code on IMXRT platform

1,546 Views
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!

Labels (1)
Tags (3)
0 Kudos
Reply
2 Replies

1,247 Views
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 Kudos
Reply

1,527 Views
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 Kudos
Reply