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

Fix for issue #8155 (NRF52832: time stops after 35 minutes) #8165

Merged
merged 1 commit into from Sep 24, 2018

Conversation

Projects
None yet
7 participants
@mprse
Member

mprse commented Sep 18, 2018

Description

Low power Timer is used as RTC for platforms that don't have HW RTC capabilities (like NRF52832).
_rtc_lpticker_read(void) function currently uses Timer::read() function to trace elapsed seconds.
Timer::read() returns seconds represented as float value, but this value is calculated from int since Timer::read_us() returns int.
This limits time tracing to ~35 min.
To fix this problem we will use timer::read_high_resolution_us() (which returns unsigned 64 bit value) instead of Timer::read().

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change
Fix for issue #8155 (NRF52832: time stops after 35 minutes)
Low power Timer is used as RTC for platforms that don't have HW RTC capabilities (like NRF52832).
`_rtc_lpticker_read(void)` function currently uses `Timer::read()` function to trace elapsed time.
`Timer::read()` returns seconds represented as `float` value, but this value is calculated from `int` since `Timer::read_us()` returns `int`.
This limits time tracing to ~35 min.
To fix this problem we will use `timer::read_high_resolution_us()` (which returns unsigned 64 bit value) instead of `Timer::read()`.

@0xc0170 0xc0170 requested a review from ARMmbed/mbed-os-hal Sep 18, 2018

@0xc0170 0xc0170 requested a review from RobMeades Sep 18, 2018

@RobMeades

This comment has been minimized.

Contributor

RobMeades commented Sep 18, 2018

Yup, that's the fix, my test code now sees no return to zero at the 35 minute (~2150 seconds) mark:

213: started wait at 2123, time now 2133, difference 10.
214: started wait at 2133, time now 2143, difference 10.
215: started wait at 2143, time now 2153, difference 10.
216: started wait at 2153, time now 2163, difference 10.
217: started wait at 2163, time now 2173, difference 10.
@TacoGrandeTX

This comment has been minimized.

Contributor

TacoGrandeTX commented Sep 19, 2018

Super - this also fixes #7836. My PR for that was not good and I haven't returned to it yet.

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Sep 20, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Sep 23, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Sep 23, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170 0xc0170 merged commit ac6ca73 into ARMmbed:master Sep 24, 2018

14 checks passed

ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed , RTOS ROM(+0.0%) RAM(+0.0%)
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/cloud_client_smoke_test Test job: successful
Details
travis-ci/astyle Passed, 599 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9914 cycles (+779 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8372B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment