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

[nrf fromlist] tests: drivers: timer: grtc: Fix GRTC test #1672

Merged
merged 1 commit into from
May 16, 2024

Conversation

adamkondraciuk
Copy link
Contributor

The z_nrf_grtc_timer_get_ticks() function converts system ticks to GRTC ticks. It gets the current system tick to calculate an absolute GRTC value. The same does the test function to provide an argument to be converted. If the system tick occurs between those sys_clock_tick_get() calls the z_nrf_grtc_timer_get_ticks() will take into account the newer tick while the test estimate bases on the old tick value. Due to that the maximum result error is 1 system tick minus 1 GRTC tick which equals (CYC_PER_TICK - 1) for GRTC ticks.

Upstream PR: zephyrproject-rtos/zephyr#71688

Copy link
Contributor

@katgiadla katgiadla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on-target

@adamkondraciuk adamkondraciuk force-pushed the grtc_fix_tests branch 3 times, most recently from c40933d to 4984ccd Compare May 13, 2024 07:11
@masz-nordic masz-nordic removed their request for review May 15, 2024 10:46
The `z_nrf_grtc_timer_get_ticks()` function converts system ticks
to GRTC ticks. It gets the current system tick to calculate an
absolute GRTC value. The same does the test function to provide
an argument to be converted. If the system tick occurs between those
`sys_clock_tick_get()` calls the `z_nrf_grtc_timer_get_ticks()` will
take into account the newer tick while the test estimate bases on
the old tick value. Due to that the maximum result error is 1 system
tick minus 1 GRTC tick which equals (`CYC_PER_TICK` - 1) for GRTC
ticks.

Upstream PR: zephyrproject-rtos/zephyr#71688

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
@nordicjm nordicjm merged commit 1a8f9cb into nrfconnect:main May 16, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants