Hello,
I am working on the i.MX RT1064- EVK, which has 4 MB of internal FlexSPI NOR flash.
My application is currently running from this flash, but I also need to erase and program parts of the same flash at runtime.
What I’ve done so far:
I ran the SDK examples flexspi_nor_polling_transfer and ota_mcuboot_server_enet on the EVK — both examples work standalone on the board.
When I integrate the FlexSPI erase/program/read functions from flexspi_nor_polling_transfer into my application, calls to the FlexSPI NOR functions always end in a HardFault (infinite loop).
The ota_mcuboot_server_enet example uses an mflash wrapper; integrating those wrappers into my project also fails.
I suspect this is an XIP / execution-from-flash conflict (code being executed from flash while the flash is being erased/programmed), or a cache/MPU/driver-init issue.
Solved! Go to Solution.
Hi @shreya1 ,
Thank you so much for your interest in our products and for using our community.
There are some description about your issue in AN12564-Implement RWW on i.MX RT Series.
Most of Flash do not support Read While Write(RWW). You need allocate the flash write function to other memory(except currently writing flash, generally allocate to
internal SRAM), and disable interrupt to avoid any unexpected flash access until writing operation complete.
The SDK example "evkmimxrt1064_flexspi_nor_polling_transfer" moves the Flash-related operation code to run in Sram.
Wish it helps you.
If you still have question about it, please kindly let me know.
Best Regards
MayLiu
Hi @shreya1 ,
Thank you so much for your interest in our products and for using our community.
There are some description about your issue in AN12564-Implement RWW on i.MX RT Series.
Most of Flash do not support Read While Write(RWW). You need allocate the flash write function to other memory(except currently writing flash, generally allocate to
internal SRAM), and disable interrupt to avoid any unexpected flash access until writing operation complete.
The SDK example "evkmimxrt1064_flexspi_nor_polling_transfer" moves the Flash-related operation code to run in Sram.
Wish it helps you.
If you still have question about it, please kindly let me know.
Best Regards
MayLiu
Hi @mayliu1,
Thank you for your prompt response.
The issue was resolved by copying the entire linkscripts folder from the example project into mine, but deleting the bss.ldt file. The problem was that this file was introducing an extra BSS section definition that conflicted with the default linker script generated by the IDE. Removing it allowed the build system to use the correct memory layout, and everything compiled and linked successfully and the mflash and FlexSPI-related functions were correctly placed into SRAM_ITC to enable execution from SRAM while performing flash operations such as erase and write.