2025-09-16 11:17 PM
I am developing a system with STM32WB5MMG module.
A pushbutton is connected to PA0 and is used to control the system power state:
During runtime, PA0 works as an EXTI interrupt to request shutdown.
In shutdown mode, PA0 should act as the wakeup source.
At the moment the shutdown is requested, the system is fully initialized:
Both cores (M4 and M0+) are running,
The BLE stack is active and functional,
Clocks, peripherals, and services are all started.
Before calling the shutdown function, clocks and peripherals are stopped.
So the transition into shutdown happens from a stable and fully operational state.
Entering shutdown works as expected: the current consumption drops to nearly 0 µA.
Once the button is pressed to wake up:
Without the debugger, I can see consumption rises to about 3–4 mA, but the application does not start.
With the debugger connected, I can see the program counter and the system falls into the HardFault handler immediately after wakeup.
HardFault debug info:
PC = 0x1FFF1A3C
Is there a complete shutdown / wakeup example available for STM32WB5MMG that demonstrates this flow in a fully working system, including BLE initialization and operation?
Thank you.
2025-09-17 12:35 AM
Use PA0 as EXTI during runtime, then before shutdown clear its EXTI flag and configure it as a wakeup source in PWR. Note that wakeup from shutdown resets the MCU, so you must reinitialize cores and BLE stack after restart.