2025-06-21 3:54 PM
Hi All,
I'm struggling to get LPTIM1 to wake from STOP mode on the STM32U5 series parts. I have a STM32U575ZI Nucleo board. When I use SLEEP mode, the LPTIM1_IRQHandler in stem32u5xx_it.c is hit. When I use STOP mode, it is not. I made an example with CubeMx to make it as simple as possible. I'll attach the CubeMx ioc and main.c, but see below for the snippit with all the CubeMx comments removed. Presumably its not an issue with the LPBAM, as if I set the RCC->SRDAMR to all ones, it still fails.
Any ideas?
Thanks
Jeff
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_LPTIM1_Init();
__HAL_RCC_LPTIM1_CLKAM_ENABLE();
HAL_LPTIM_Counter_Start_IT(&hlptim1);
while (1)
{
HAL_SuspendTick();
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); // Doesn't work
//???HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFI); // Works
HAL_ResumeTick();
}
}
2025-06-23 10:04 AM
Hello @Jeff Gros ,
Please refer to this article which may help you: Troubleshooting waking up from stop mode issues with LPTIM in STM32U5
2025-06-23 10:12 AM
Hi Imen,
Thanks for the link. I did review this when I reviewed other posts trying to see if this was already solved. Regarding the article:
1. I'm using LPTIM1 clocked from LSI. Since I'm clocked from LSI, the clock source should persist in STOP modes. LPTIM1 shouldn't have any restrictions with any of the STOP modes but what I observe is that it fails to wake in all the stop modes, not just STOP2.
2. __HAL_RCC_LPTIM1_CLKAM_ENABLE is present in the code above. As mentioned, if I set RCC->SRDAMR to all ones, it still will not wake.
3. LPTIM1 is not being disabled.
Thanks for the link, but I don't think any of these apply.
Thanks
Jeff