Hi,
In my custom board I'm using an external NOR Flash connected to FLEXSPI1.
I need to partition this external flash, so it can contain code and also a filesystem. I'm using FreeRTOS and the filesystem is LittleFS.
I have seen some posts that a solution is to execute code from RAM, but this is not possible in my case. I need to be able to run code from flash and use it as filesystem storage as well.
Please give directions on how to do it. At the moment I'm getting hard faults.
1) Do I need to create a partition in MCU Settings?
2) How to configure the MPU in this case?
Is there and example available that shares external NOR flash between code and filesystem?
Thank you,
Patricio
Solved! Go to Solution.
Hi @patriciocohen ,
You can move erase and program function code to SRAM. When it is executing, disable all interrupt and stay in SRAM. The flexspi demo in SDK works in this way.
Or you can use two spi flash.
Regards,
Jing
Hi @patriciocohen ,
It's very hard to XIP while littlefs access nor flash. LittleFS access NOR flash in IP command mode(write, erase), XIP read flash on AHB bus. This will certainly cause conflict.
Regards,
Jing
Hi @jingpan
Thanks for your reply.
Is there a way to do this that you can think of?
Best regards,
Patricio
Hi @patriciocohen ,
You can move erase and program function code to SRAM. When it is executing, disable all interrupt and stay in SRAM. The flexspi demo in SDK works in this way.
Or you can use two spi flash.
Regards,
Jing