2019-04-22 04:57 AM
I'm toggling an I/O in the SYSTICK interrupt every 0.5 seconds with the processor running at 168MHz and using an RTC interrupt to wake the CPU from sleep. This all works well and the processor wakes up after the programmed interval. As per the HAL manual, the CPU is running on HSI (16MHz) after waking from sleep. Whatever I do I can't seem to get the clock changed back to HSE/PLL. I've tried all variants of explicitly turning PLL off, running the full clock configuration, and running the Cube example code but whatever I do the I/O toggles at 5 seconds rather than 0.5 (168/16 * 0.5) after the wake from sleep.
I've got similar code running perfectly on the L4 chips.
All ideas appreciated
2019-04-22 11:13 PM
Hi
For Sleep mode the clock source after wakeup is the same as before entering Sleep mode.
STM32L4 family has different power modes than STM32F4 family like Low Power Sleep.
2019-04-23 12:00 AM
Sorry my question was imprecise, I used sleep when I intended to use stop.
From the F4 HAL manual
"In Stop mode, all I/O pins keep the same state as in Run
mode.
When exiting Stop mode by issuing an interrupt or a wake-up
event, the HSI RC oscillator is selected as system clock."
2019-04-23 01:34 AM
If you use HAL functions HAL_InitTick, HAL_SetTickFreq, have in mind that SystemCoreClock variable must have been updated first by calling SystemCoreClockUpdate.