cancel
Showing results for 
Search instead for 
Did you mean: 

i am trying to wakeup stm32lo from sleep mode by interrupt push button connected to pA3

NASOK.1
Associate II
 HAL_SuspendTick();
 
       /* Enter Sleep Mode,
        *
        */
   HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);
 
       /* Resume Tick interrupt if disabled prior to SLEEP mode entry */
       HAL_ResumeTick();
I HAVE THE ABOVE CODE IN MY WHILE LOOP 
AND MY CALLBACK IS
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
// if(GPIO_Pin == WKUP_INT_Pin)
// {
// HAL_GPIO_WritePin(GPIOB, USERLED_Pin, GPIO_PIN_SET);
// }
if(GPIO_Pin == STEP_INT_Pin)
{
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);
} else {
__NOP();
}
}
I AM NOT AT ALL ENTERING THE SLEEP MODE THOUGH.
1 REPLY 1
RomainR.
ST Employee

Hello @NASOK.1 

How do you find that the STM32L0 never goes into sleep?

Can you try the following example ? 
https://github.com/STMicroelectronics/STM32CubeL0/tree/master/Projects/NUCLEO-L053R8/Examples/PWR/PWR_SLEEP

BR
Romain, 

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.