2026-05-11 2:37 PM
Hello,
I am working on a project using an STM32H7S3 with an XSPI NOR Flash (ISSI IS25WX064) running in XIP (Execute-in-Place) memory-mapped mode. The firmware is split into two stages: a Bootloader and an Application context executing directly from the external flash.
I need to put the flash into Deep Power-Down mode (command B9h) before the STM32 enters Standby, in order to minimize total system current consumption. On wake-up, the Bootloader handles the Release from Deep Power-Down (ABh) before re-entering memory-mapped mode and jumping to the Application.
I am struggling to find a clean way to send the Deep power down command from the Application context. The main obstacles are:
1. The XSPI handle (hxspi1) lives in the Bootloader context, so the Application does not have direct access to it.
2. The Application code runs from XIP flash. This means that aborting the memory-mapped mode (required before sending any command) from code that itself is fetched through that same memory-mapped interface causes a HardFault, since the CPU loses its instruction stream the moment the memory-mapped mode is disabled.
3. HAL_XSPI_Abort() with a partially re-initialized handle (only Instance set, rest zeroed) also triggers a HardFault because HAL checks internal state fields that are not valid.
I would like to know if is there an officially recommended or cleaner HAL/BSP approach to send a command to an XSPI flash that is currently in memory-mapped (XIP) mode, from an application that is itself executing from that flash?
Thank you so much in advance and best regards!
2026-05-11 7:01 PM
Since your bootloader already has code to exit the power-down, place the code to enter the power-down and standby in the bootloader and call it from the app ?