-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix for issue #5308 - RTC set/get time issue on NCS36510 #6852
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
Conversation
In current implementation `rtc_read` function returns number of elapsed us and `rtc_write` function sets RTC time to specified value in us. Mbed HAL API expects that these functions operate on seconds. Since lp ticker is also based on RTC provide mechanism to trace elapsed seconds without modifying RTC registers.
Currently test assumes that 1 sec is long enough to set RTC time and read same time which has been set. In some cases extra time for synchronisation between clock domains is needed and after setting/reading operations the read value might be different than one which has been set (+1 sec). Additionally in some cases when lp ticker is based on RTC, the RTC implementation may use mechanism to trace elapsed seconds without modifying RTC registers. In such case it is possible that second will change immediately after setting time. Add 1 sec tolerance (min possible) for such checks.
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.
LGTM!
/morph build |
@mprse Since this updates a test, we're going to run the test CI a couple of times to make sure the test is sound. |
Build : SUCCESSBuild number : 1966 Triggering tests/morph test |
Test : SUCCESSBuild number : 1780 |
Exporter Build : SUCCESSBuild number : 1617 |
Test CI has been run only once before merging, but the change in the test only relax constraints (adding tolerance), so this change should not have bad influence on other targets. |
Thanks @mprse. In the partner workshop, it was discussed that the hardware RTC on this chip doesn't retain the time through a reset, which was part of the new Mbed HAL specification. Thus the hardware RTC was going to be re-purposed for the Low Power Ticker driver. |
Description
The problem was caused by wrong implementation of
rtc_read()
andrtc_write()
routines which were operating on us instead of seconds.Provide fix for Issue# #5308.
Modify
tests-mbed_drivers-rtc
test: add one second tolerance(min possible) in functional tests.Enable
RTC
support forNCS36510
.Pull request type