Skip to content
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

Feature request: Timer management API #7520

Closed
4 tasks
pizi-nordic opened this issue May 14, 2018 · 5 comments
Closed
4 tasks

Feature request: Timer management API #7520

pizi-nordic opened this issue May 14, 2018 · 5 comments
Assignees
Labels
area: API Changes to public APIs area: Timer Timer Feature Request A request for a new feature

Comments

@pizi-nordic
Copy link
Collaborator

The generic timer API provided by the Zephyr does not abstract low-level timer properties, which are essential in low power embedded applications. As result the user is not able to fully utilize hardware capabilities.

We can easily identify four key parameters of each hardware timer in the system:

  • Resolution
  • Accuracy
  • Power Consumption
  • Start-up Time

Depending on the use case and current system state a different timer might be used as a time source.
For example a simple Bluetooth application might use 3 different timers during normal operation:

  • The low-frequency RC oscillator may be used during system wakeup, as it has minimal start-up time.
  • When idle, a more accurate XTAL-based oscillator could be used to reduce power consumption (Bluetooth RX window might be shortened if accurate clock source is available).
  • From time to time, when some activity is performed, a high frequency oscillator might be turned on in order to increase time base resolution.

This issue has been created as a generalization of #6498

Things needed:

  • Abstraction of low-level timer properties (resolution, accuracy, startup time, maybe power consumption)
  • Universal and precise abstraction of time (time cannot be stored in timer "clocks" as time base could change at any moment).
  • API for selecting most suitable clock source in run-time.
  • API informing subsystems about clock source change (BT will need this to adjust RX window).
@pizi-nordic
Copy link
Collaborator Author

CC: @carlescufi @cvinayak

@andyross
Copy link
Contributor

Noting for posterity that such a feature is likely to interact in complicated ways with tickless kernel support, which in some sense speaks to exactly the same use cases and should be unified. Honestly tickless is a little bitrotten right now -- really we should be using it by default on most platforms where support is available.

@pizi-nordic pizi-nordic added Feature Request A request for a new feature area: Timer Timer area: API Changes to public APIs labels May 15, 2018
@carlescufi
Copy link
Member

@nordic-krch could you please check if this still applies?

@zephyrbot
Copy link
Collaborator

Hi @andyross,

This issue, marked as an Feature Request, was opened a while ago and did not get any traction. It was just assigned to you based on the labels. If you don't consider yourself the right person to address this issue, please re-assing it to the right person.

Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.

@pizi-nordic you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you.

Thanks!

@andyross
Copy link
Contributor

andyross commented Feb 9, 2024

Closing. It seems like most of the practical requirements here have long since been met, we have multiple architectures that can do clock switching across idle. We can always reopen to argue about design, but I think half a decade is enough time for this to have matured.

@andyross andyross closed this as completed Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Timer Timer Feature Request A request for a new feature
Projects
None yet
Development

No branches or pull requests

4 participants