zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
9.74k stars 6k forks source link

pm: System pm fixes and cleanup #72179

Open ceolin opened 2 weeks ago

ceolin commented 2 weeks ago

The main fix in this pr is in the wake up procedure. When the system was waking up the notification coming from the ISR was not properly restoring the system. Devices were not being restored there, this means that the ISR wouldn't be able any device that was previously suspended.

ceolin commented 2 weeks ago

The images below show the problem happening.

This first graphic we can see the energy consume getting constantly high after the system attempts to use uart in the ISR that woke up the system bug

Now the same code but with these fixes applied working

The spikes were cause by the interruption and as we can see the system goes back to sleep properly again and all power consumption falls.