How to write external flash while the code is executing in the same external flash (QSPI configured in memory map mode)?
Dear all,
I need to write the external flash while the code is executing in the same external flash (QSPI configured in memory map mode).
I know that in this mode it's only possible (obviously) to read the flash but I need to update firmware.
To do this I can implement one bootloader in internal flash but if it's possible I want to implement the writing operations in the application (therefore in external flash).
I'm thinking to implement the functions to erase and write the external flash in a fixed position of internal flash memory (with linker script) and call this function in external flash when I want to write the external flash.
Inside these functions I switch in indirect mode using the erase or wirite HAL functions and, before to return from function, activate again the memory map mode.
1° question: this idea could works fine?
2° question: for call the functions in internal from external flash, can I use the same code that I use to jump from internal to external flash (like this: https://community.st.com/s/question/0D50X00009Xkdol/stm32l4-bootloader-on-internal-flash-jumping-to-application-on-external-flash)?
Thanks in advance.
Luca G
