cancel
Showing results for 
Search instead for 
Did you mean: 

Doubts about using QSPI for STM32L431?

zhangtinglu
Associate III

Now the project uses STM32L431RC external nor flash to save the data. I want to replace STM32L431RB external QSPI flash, which can reduce the cost, but the program byte is too large, so it needs to be put into the QSPI device to run. QSPI flash is divided into two parts, one is to put programs, the other is to save data,

QSPI uses the memory sharing mode, and there is no problem in executing the program. For the part of saving data, reading is as easy as internal flash, but how can I erase the updated data?

4 REPLIES 4

You'll need to erase and program in direct mode. See speeds and sizes from memory IC data sheet.​

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

The program is in QSPI flash, which will make the program unable to run

Andreas Bolsch
Lead II

That's a bit difficult: During erase or page programming, the external flash (the whole chip!) is not readable, it will only respond to status register reads (on some devices, it's possible to suspend the erase/program operation temporarily, but that's even more complicated). So, during these operations, the CPU can only execute from internal flash.

As the program/erase may take a long time, that might not be acceptable.

One partial solution would be to use two external flash chips, either with QSPI in dual flash mode (not possible due to pin availability on the L431RC) but only one active at any time by switching the FSEL bit, or two wired in parallel except for NCS. The L431RC offers two choices, PA02 and PB11, for QUAD_BK1_NCS, these could easily be switched dynamically. Or even some simple glue logic for selecting either of two. One chip for code, one for data, but this means that data access always has to be done from internal flash ...

If even that is not acceptable, the last resort would be two flash chips but with identical contents. While one is busy during erase/programming, the other is used for code execution. After completion of flash operation switch the roles and repeat the operation on the other chip.

Thank you. I have to find another way.