Skip to content

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

Merged
merged 3 commits into from
May 11, 2018

Conversation

mprse
Copy link
Contributor

@mprse mprse commented May 9, 2018

Description

The problem was caused by wrong implementation of rtc_read() and rtc_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 for NCS36510.

Pull request type

[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

mprse added 3 commits May 9, 2018 14:41
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.
Copy link
Contributor

@cmonr cmonr left a comment

Choose a reason for hiding this comment

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

LGTM!

@cmonr
Copy link
Contributor

cmonr commented May 9, 2018

/morph build

@cmonr
Copy link
Contributor

cmonr commented May 9, 2018

@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.

@mbed-ci
Copy link

mbed-ci commented May 9, 2018

Build : SUCCESS

Build number : 1966
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6852/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented May 9, 2018

@mbed-ci
Copy link

mbed-ci commented May 10, 2018

@cmonr cmonr merged commit 30e39ee into ARMmbed:master May 11, 2018
@mprse
Copy link
Contributor Author

mprse commented May 11, 2018

@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.

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.

@maclobdell
Copy link
Contributor

Thanks @mprse.
Needs review by @ARMmbed/team-onsemi.

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.

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.

5 participants