AnsweredAssumed Answered

PLL Ready Interrupt not firing as expected

Question asked by prentice.simon on Nov 18, 2016
Latest reply on Nov 21, 2016 by prentice.simon
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?

Outcomes