Skip to main content
Explorer II
September 18, 2024
Question

STM32L452 wakeup issue

  • September 18, 2024
  • 1 reply
  • 559 views

Hello,

My STM32L452 Nucleo-64 board does not wake up from sleep mode by an external interrupt.

Interrupts are working, but after calling this function:

 

HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFI);

 

Program wait on this function (checked by debugger):

 

 __WFI();

 

And no extern interrupts - I try IEXT10_15 and IEXT0 doesn't wake it up.

After restoring the debugger, the program continues normally.

Some settings:

 

 GPIO_InitStruct.Pin = BUTTON1_Pin;
 GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
 GPIO_InitStruct.Pull = GPIO_NOPULL;
 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);

 __HAL_RCC_GPIOC_CLK_ENABLE();

 __HAL_RCC_SYSCFG_CLK_ENABLE();
 HAL_NVIC_SetPriority(EXTI15_10_IRQn, 15, 15); // Set priority
 HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); // Enable the interrupt

 

The interrupts are normally handled and working. But after going to sleep mode, nothing happens after pressing the button or after another interrupt arrives (2 USARTs and 3 GP inputs).

What could be wrong?

Thanks a lot,
Jan.

    This topic has been closed for replies.

    1 reply

    ST Employee
    September 19, 2024

    Hello Jan, 

    The configuration you provided seems correct, but double-check the EXTI line configuration

    You can refer to this wiki article using EXTI to wakeup from different stop modes: Getting started with PWR - stm32mcu