2016-11-18 07:06 AM
STM32L053R8 (Nucleo dev board)
When setting the PLL state in HAL_RCC_OscConfig, rather than sit in a while loop waiting for RCC_CR_PLLRDY I want to enter sleep mode and wake based on the PLL ready interrupt. I have a locally modified version of HAL_RCC_OscConfig which (A) clears the flag (if set, which it isn't), (B) enables the interrupt, (C) disables systick (to stop systick from waking it), (D) enter sleep mode: (A) RCC->CICR |= RCC_CICR_PLLRDYC; (B) __HAL_RCC_ENABLE_IT(RCC_IT_PLLRDY); (C) SysTick->CTRL = 0; (D) HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFI); I was expecting it to hit an interrupt when the PLL is set and then leap out of sleep mode back into normal operation. I have tried waiting for RCC_IT_PLLRDY (E) and that works but I want to be in a lower power state while the PLL settles. (E) while ((RCC->CR & RCC_CR_PLLRDY) == 0); I have tried leaving systick enabled and that makes no difference. I have RCC_IRQHandler() declared in the same file as RTC_IRQHandler() and EXTI2_3_IRQHandler() but it is never hit. I suspect/hope I am missing something simple and obvious. Has anyone successfully used the PLL ready interrupt? Are there any examples people are aware of that would help me to determine what I have done wrong? #stm32l0-pll #pll #stm32l0xx2016-11-18 08:36 AM
Not using the L0, do you get the interrupt if you don't sleep the core? How long do you see the PLL taking to lock?
2016-11-18 10:29 AM
Wait for PLL ready in state where all clock are off? GOOD IDEA.
this will never work2016-11-21 02:15 AM
Thank you for the clear reply.
It had been suggested to me as a way to save power while waiting. I'll look down other avenues.