cancel
Showing results for 
Search instead for 
Did you mean: 

using external flash in command mode while running firmware from it in memory-mapped mode?

roganmorrow
Associate

My firmware application is stored in external NOR flash which is memory mapped using XSPI and then loaded by a bootloader. However I also need to interface with the external NOR flash in command mode so I can e.g. store a filesystem there. I can't switch out of memory mapped mode because then my application can't run. How am I meant to get around this dilemma?

2 REPLIES 2
KDJEM.1
ST Employee

Hello @roganmorrow and welcome to the community;

 

Could you give more details about the external NOR flash memory and the STM32MCUs? Is the external memory supporting the multibank feature?

Are you using the XSPI read-while-write feature and XIP on STM32 MCUs?

 

Thank you.

Kaouthar

 

 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

>>How am I meant to get around this dilemma?

Going to be awkward.

You could make some hard choices.

You can HAL_QSPI_Abort() out of memory mapped mode, but then you'd need to prevent other code from accessing and running from the external memory during that period. Watch for interrupts and threaded execution. Probably not ideal going out-to-lunch for 10's or 100's of milliseconds.

Put read-only portion of the file system on the NOR Flash? Use a RAM-DISK for volatile stuff.

You could put your file system on a more suitable memory like an eMMC, or use another NOR Flash on a SPI bus.

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..