-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cortex-M SysTick: extend support for low-power mode features #84102
base: main
Are you sure you want to change the base?
Cortex-M SysTick: extend support for low-power mode features #84102
Conversation
The Cortex-M SysTick supported collaboration with a so-called "IDLE timer" to work even in low-power modes, when the SoC may disable its clock. Rename "IDLE timer" to "low-power mode timer" to better reflect what this timer is used for, and transform the single option into a Kconfig choice to allow other behaviors to be implemented and chosen. Signed-off-by: Mathieu Choplain <[email protected]>
Add support for a hook-based low-power mode timer to the Cortex-M SysTick driver, in addition to the existing Counter API-based timer. This is useful on platforms such as the STM32WB0 where the wake-up timer is too limited for a Counter API driver to be implemented on top of it. Signed-off-by: Mathieu Choplain <[email protected]>
…mode Modify the Cortex-M SysTick driver to work when the SoC resets SysTick in low-power mode. This adds an invisible Kconfig symbol that must be selected by SoCs with such behavior. Signed-off-by: Mathieu Choplain <[email protected]>
b398cdf
to
e080448
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LPTIM is an STM32-specific name, should be replaced by Low Power Timer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As defined in the comment, LPTIM is used here as an acronym, not as reference to the STM32-specific hardware (WB0 doesn't even have it). I'm fine with changing to LPtim
/ LPMTIM
/ <your proposal here>
to avoid confusion though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think it should be changed in order to avoid confusion.
For the record, the commits of this PR are used on https://github.com/mathieuchopstm/zephyr/tree/wb0_deepstop_poc to implement Deepstop suspend-to-RAM low-power mode on STM32WB0 series. |
This PR aims to improve several aspects of the Cortex-M SysTick driver related to low-power mode/PM, mainly for support of Deepstop LPM on STM32WB0 series.
The existing implementation supports a companion "IDLE timer", but it must implement the Counter API, which can be a poor fit depending on the hardware. However, the only things the SysTick drivers requests from the companion time is:
This PR implements a simple ("hook-based") API that the SysTick driver can use to perform these two functions in place of the Counter API timer, which is useful when the platform-specific timer is a poor fit for the Counter API.
Another limitation of the driver is that it expects SysTick to remain powered in low-power modes, which is not true on some SoCs. This PR creates a new Kconfig symbol which, if selected, modifies the SysTick driver such that it stops the counter cleanly before low-power mode entry, and restarts it after low-power mode exit.
This PR is a proposal, hence the DNM label - I don't think the changes are large enough to warrant the RFC label. Comments are nonetheless welcome and highly appreciated 😄