Skip to content

fix(sleep): use pm_power_state_force for proper device power management#1291

Merged
petejohanson merged 1 commit intozmkfirmware:mainfrom
Nicell:power/fix-device-sleep
May 17, 2022
Merged

fix(sleep): use pm_power_state_force for proper device power management#1291
petejohanson merged 1 commit intozmkfirmware:mainfrom
Nicell:power/fix-device-sleep

Conversation

@Nicell
Copy link
Copy Markdown
Member

@Nicell Nicell commented May 6, 2022

When using pm_power_state_set, we skip over all of the device-related power management seen here: https://docs.zephyrproject.org/latest/services/pm/system.html#system-power-management

Although I wasn't able to 100% confirm this from reading Zephyr code, pm_power_state_force seems to force the next state to what you want, and then all of the rest of the diagram follows as expected setting device power states. In our case, STATE_OFF sets devices to standby, which is why those actions got updated.

We should probably be aware of the fact that this currently just sets CPU 0 to off. This may be an issue with dual/multi-core chips like the nrf5340. I'm not sure about that though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants