2026-03-18 4:36 AM - last edited on 2026-03-18 4:41 AM by Andrew Neil
Solved! Go to Solution.
2026-03-19 1:20 AM
Hello,
Almost the same question asked in this post.
You can't write to that memory while executing from it. You said it yourself: you need to switch from memory-mapped mode to indirect/command mode so the instruction fetch is no more available.
Need either:
- To use two external XSPI memories: one for execution and one for the data storage so you don't have a such issue. Refer to the AN6228 "How to implement XSPI read-while-write feature on STM32 MCUs"
- Or to execute that code that writes to the external flash from the internal Flash (could be a bit tricky).
Hope I've answered your question.
2026-03-19 1:20 AM
Hello,
Almost the same question asked in this post.
You can't write to that memory while executing from it. You said it yourself: you need to switch from memory-mapped mode to indirect/command mode so the instruction fetch is no more available.
Need either:
- To use two external XSPI memories: one for execution and one for the data storage so you don't have a such issue. Refer to the AN6228 "How to implement XSPI read-while-write feature on STM32 MCUs"
- Or to execute that code that writes to the external flash from the internal Flash (could be a bit tricky).
Hope I've answered your question.
2026-03-23 12:44 PM
Hello
For my side i was wondering how to do a FW update ( so write data to XSPI1 while XIP) .
I checked the application note AN6228 but it is so hard to configure it because it require to have 2 config one with flash + psram and one with only flash and 2 port multiplexed.
So for that i write from the internal flash code (BOOT) to XSPI1 . It is really easy to do it you can take exemple of the EXTMEM functions used in the memory manager included in boot. Or you can check exemple in cubeh7rs to write to flash with xspi commands.