cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L431 can't enter STOP2 mode

TClar.8
Associate II

I'm trying to enter STOP2 mode to save energy but the MCU get stuck in the function HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI). I have cleared all EXTI pending flags and RTC flags, and disable all five wake up pins. The MCU is supposed to wake up via RTC alarm interrupt. The program resumes by clearing RTC flag and calling system clock config and gpio init functions.

I have done this with STANDBY and SHUTDOWN modes without trouble, and I can't understand why I can't enter STOP2 mode as well. Anyone has got an idea?

11 REPLIES 11

@Alex R already mentioned how to disable the extra peripherals.

Clearing interrupts is done by clearing the EXTI interrupt pending bits and NVIC interrupt pending bits.

They don't stay cleared, if there is a peripheral interrupting, though.

The pod can be used if the DBG_STOP bit is set in DBGMCU_CR.

TClar.8
Associate II

[RESOLVED] Thank you all, your advices have been useful and convicing!

Finally, I could get it working by disabling SysTick interrupt and then resuming the interrupt when the MCU wakes up.