Skip to main content
SLevi.1
Associate III
February 20, 2025
Solved

STM32WLE5 Exit stop mode 2 on EXTI or RTC timer

  • February 20, 2025
  • 2 replies
  • 1020 views

I cannot get STM32WLE5 (on a RAK3172 module) to exit from stop mode on either RTC timer or rising EXTI pin.

I'm using STM Cube HAL functions and the stm32_lpm_if.c library. I have tried pin PB3 as either  EXTI3 or as PWR_WKUP3. If I use EXTI3, I set an interrupt handler. The handler gets called when the pin goes high in normal running, but when in stop2 mode, it does not wake up.

Does anyone have example code using this chip/module to do a wakeup on timer OR external pin?

Best answer by SLevi.1

Looks like this may be a solution in stm32_lpm_if.c:

RCC->CFGR |= RCC_CFGR_STOPWUCK;

 

 

void PWR_EnterStopMode(void)
{
/* USER CODE BEGIN EnterStopMode_1 */
/* USER CODE END EnterStopMode_1 */

 HAL_SuspendTick();
/* Clear Status Flag before entering STOP/STANDBY Mode */
 LL_PWR_ClearFlag_C1STOP_C1STB();

/* USER CODE BEGIN EnterStopMode_2 */
 RCC->CFGR |= RCC_CFGR_STOPWUCK; // I think this one did the trick
/* USER CODE END EnterStopMode_2 */

 HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);

/* USER CODE BEGIN EnterStopMode_3 */
/* USER CODE END EnterStopMode_3 */
}

 

2 replies

TDK
Super User
February 20, 2025

> How to enter the Stop 2 mode and wake-up from this mode using an external reset
or RTC wakeup timer.

STM32CubeWL/Projects/NUCLEO-WL55JC/Examples/PWR/PWR_STOP2_RTC/readme.txt at 9d77b66f25362a849ef48fd2369060e3718fc99d · STMicroelectronics/STM32CubeWL

 

Edit: I guess this is a different chip? Maybe it will still be useful.

"If you feel a post has answered your question, please click ""Accept as Solution""."
SLevi.1
SLevi.1Author
Associate III
February 21, 2025

Hi,

from the readme of that example :

How to enter the Stop 2 mode and wake-up from this mode using an external reset
or RTC wakeup timer.
EXTI_Line20 is internally connected to the RTC Wakeup event.

I cannot see the assignation of any pin to be the "external reset" - I would have expected some EXTI line to be used. There is no IRQ handler for any EXTI line, not even number 20.

Also, what does "internally connected" mean? I want a real world piece of wire to be a wakeup source.

TDK
Super User
February 21, 2025

Didn't you say you wanted an RTC timer wakeup?

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate II
November 6, 2025

Hello,

 

I am also facing same issue, I tried the step mentioned but didn't solved. 

If you have done, can you share any reference code Lorawan+stopmode+rtc