2019-05-19 08:51 AM
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."
2019-05-19 10:37 AM
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.
2019-05-19 10:41 AM
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.
2019-05-19 11:19 AM
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.