2024-09-18 01:37 AM
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.
2024-09-19 03:24 AM
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
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.