Skip to content

[nrf fromlist] GRTC optimizations #2740

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nordic-krch
Copy link
Contributor

Changes in GRTC system clock driver that reduce time spend in GRTC calls by approx. 50%.

PR created to run NCS CI on that change.

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Apr 10, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_nordic zephyrproject-rtos/hal_nordic@a5a2277 (master) zephyrproject-rtos/hal_nordic#288 zephyrproject-rtos/hal_nordic#288/files

DNM label due to: 1 project with PR revision

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@nordic-krch nordic-krch force-pushed the ncs/grtc_optimization branch 2 times, most recently from 0d72e4d to 9c533ef Compare April 24, 2025 11:18
@nordic-krch nordic-krch force-pushed the ncs/grtc_optimization branch 2 times, most recently from 51a64be to 25d225b Compare May 6, 2025 07:14
…ister access

Speed up execution of the interrupt handler and sys_clock_set_timeout().
Sys_clock_set_timeout() can be called in two scenarios: from previous
timeout expiration handler or freely. If the former case fast path
can be used since CC value in the GRTC register just expired and it
can be used as a reference for CCADD setting. This is only a single
register write so it's much faster. In the latter a longer procedure
is applied which also happens in two variants. If value which is
set in CC is further in the future (e.g. K_FOREVER was set before) then
CC can be safely overwritten with a new value without a risk of
triggering unexpected COMPARE event. If value in CC is earlier than
the new CC value (if earlier timeout was aborted) then there is a
risk of COMPARE event happening while it is being overwritten.
That case requires long and safer procedure of setting CC.

Update hal_nordic with changes in the nrfx_grtc driver which are
needed for nrf_grtc_timer changes.

Upstream PR #: 87944

Signed-off-by: Krzysztof Chruściński <[email protected]>
@nordic-krch nordic-krch force-pushed the ncs/grtc_optimization branch from 25d225b to b268eab Compare May 9, 2025 09:28
Copy link

sonarqubecloud bot commented May 9, 2025

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

Successfully merging this pull request may close these issues.

2 participants