-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
Describe the bug
When enabling power management with stop mode(any of the three) enabled for the STM32L5 soc, the stop mode will stop all clocks in the mcu going to that lp mode. when returning from stop mode, not all clocks are being restored, like the HSI48 clock which is being used by USB & RNG hardware blocks. When this happends, and the entropy driver needs to get new samples, it enables interrupts for the block and this starts a constant entry to the ISR due to a clock error detected int he RNG hardware block.
This endless loop in the stm32_rng_isr never gets resolved.
The problem could be resolved in the power.c of the soc to re-enable the HSI48 clock (or just use MSI as a clock source if USB is not present, the power consumption will like that much more :-) ).
Next to that, a pm constraint needs to be added to the entropy driver, preventing the mcu to go to deep sleep when the entropy driver is filling the random number pool.
Impact
no low power for the L5 and probably other families which uses the rng & stop mode (L4,...)
Environment (please complete the following information):
- OS: Linux
- Zephyr SDK, 13.1
- zephyr v2.7.99-3760-g4a0e5e9958
Additional context
I've fixed some of these thing on a local branch (at least to get it working for my case), but it's deviating a bit from the mainstream clock implementations & clock selections (using MSI, with own overriding of the weak power functions), but I could share at least the power constraints in the entropy driver.