cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot wake-up from STOP mode with LPTIM

j_filipe
Associate III

Greetings, 
I am having trouble in waking up from Stop mode in STM32U585RIT6 LQFP64 MCU. 
So I saw the following posts: 
https://community.st.com/t5/stm32-mcus/troubleshooting-waking-up-from-stop-mode-issues-with-lptim-in/ta-p/745343
https://community.st.com/t5/stm32-mcus-products/lptim-interrupt-can-t-wake-stm32u5-from-stop-low-power-mode/td-p/55162
At the main function I placed:
__HAL_RCC_LPTIM1_CONFIG(RCC_LPTIM1CLKSOURCE_LSE);
__HAL_RCC_RTCAPB_CLKAM_ENABLE();
__HAL_RCC_LPTIM1_CLKAM_ENABLE();
as it was referred in those posts. 

So I am going to stop mode in the following way: 
HAL_LPTIM_Counter_Start_IT(&hlptim1);
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);

And it was supposed to wake-up when the counter register reached the expected value.
Then I call the callback:

void HAL_LPTIM_AutoReloadMatchCallback(LPTIM_HandleTypeDef* hlptim)

   SystemClock_Config();
    .... 
}

Still isn't work. Am I missing something?
Thank you! 

1 REPLY 1
MM..1
Chief III

Have you enable NVIC interrupt? And dont place systemclockconfig in ISR callback. Simply next line after stop is ok.