STM32H7S78-DK. hangs and eventually Hard Faults writing to XSPI NOR flash
- The application is executed directly from external NOR flash (mapped at 0x70000000 via XSPI).
- Memory-mapped (XIP) mode is enabled for instruction execution.
- Read operations from external flash are working as expected.
- During erase/write operations, the system encounters hangs and eventually enters a Hard Fault condition.
- Erase/program operations require switching the XSPI interface from memory-mapped mode to indirect/command mode.
- During this transition:
- External flash is not available for instruction fetch.
- The CPU continues attempting to execute code from the same external flash.
- This results in instruction fetch conflicts, leading to system instability (hangs/HardFault).
- Additional factors increasing complexity:
- Interrupts and ISRs may still reside in external flash.
- RTOS-based execution further increases the likelihood of conflicts.
- Whether write/erase operations on the same external NOR flash are supported during XIP execution.
- Recommended approach to safely perform these operations:
- Executing flash drivers from internal RAM
- Relocating interrupt handlers to RAM
- Any required restrictions or best practices
- Availability of any reference examples or application notes specific to STM32H7S78-DK.
