cancel
Showing results for 
Search instead for 
Did you mean: 

I'm trying to resolve some ambiguity related to write-while-read of flash within the STM32L4R5ZI. If someone can straighten me out I'd appreciate it.

Rvon
Associate

The FlashErase example project in the STM32Cube_FW_L4 here:

D:\STMicro\STM32Cube_FW_L4_V1.13.0\Projects\NUCLEO-L4R5ZI\Examples\FLASH\FLASH_EraseProgram\Src seems to imply that it's possible to erase and write to the same bank of flash that you are executing from. The documentation implies that you can only perform write-while-read (or read-while-write) when in dual-bank flash mode. See section 3.3.8 of RM0432 reference manual:

"The Dual-bank mode is available only when the DBANK option bit is reset, allowing readwhile-

write operations. This feature allows to perform a read operation from one bank while

erase or program operation is performed to the other bank."

3 REPLIES 3

The STM32's have always been able to continue executing, but stuff wait-states, stalling execution, when within the same bank.

If you keep things separate, and don't read (execute, vector table, otherwise touch, etc) from the bank you're doing the erase/write on, then it won't stall, and you can handle real-time tasks.

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

As I recall the DBANK determines if the banks are SIDE-TO-SIDE or END-ON-END, the former giving speed from parallel operation, the later allowing separate flashing/interaction.

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

Thank you for the quick answer. I also figured out that the FlashErase example project is designed only to work in dual-bank mode. I missed some subtle clues in the code when I was only reading it, rather than actually running it.