Skip to content

Fix us_ticker for NRF52 series #6796

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 1 commit into from
May 7, 2018
Merged

Fix us_ticker for NRF52 series #6796

merged 1 commit into from
May 7, 2018

Conversation

marcuschangarm
Copy link
Contributor

Description

Changed comparison function when setting ticker timeout to fix
tickers not set correctly.

Pull request type

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

Changed comparison function when setting ticker timeout to fix
tickers not set correctly.
@marcuschangarm
Copy link
Contributor Author

@studavekar this might improve the lp_ticker_timeout problems we've been seeing.

@0xc0170
Copy link
Contributor

0xc0170 commented May 3, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented May 3, 2018

Build : SUCCESS

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

Triggering tests

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

@studavekar
Copy link
Contributor

@0xc0170 @cmonr

we would need multiple morph test on this PR , to make sure if the fix actually works. Also, this would be on high priority as lp_timeout fails inconsistently for NRF52 devices causing a lot of PR to be re-triggered.

@mbed-ci
Copy link

mbed-ci commented May 3, 2018

@mbed-ci
Copy link

mbed-ci commented May 4, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented May 4, 2018

/morph test

@0xc0170
Copy link
Contributor

0xc0170 commented May 4, 2018

I'll run today 2 more rounds (at least 3 test runs)

@mbed-ci
Copy link

mbed-ci commented May 4, 2018

@marcuschangarm
Copy link
Contributor Author

/morph test

@mbed-ci
Copy link

mbed-ci commented May 5, 2018

@studavekar
Copy link
Contributor

/morph test

@mbed-ci
Copy link

mbed-ci commented May 6, 2018

Test : SUCCESS

Build number : 1744
Test logs :http://mbed-os-logs.s3-website-us-west-1.amazonaws.com/?prefix=logs/6796/1744

Copy link
Member

@fkjagodzinski fkjagodzinski left a comment

Choose a reason for hiding this comment

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

I looked at this PR in reference to #6732 and found one thing worth clarifying.

uint32_t closest_safe_compare = common_rtc_32bit_ticks_get() + 2;
if ((int)(compare_value - closest_safe_compare) <= 0) {
uint32_t closest_safe_compare = RTC_WRAP(common_rtc_32bit_ticks_get() + 2);
if (closest_safe_compare - compare_value < 2) {
Copy link
Member

Choose a reason for hiding this comment

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

I might have missed something, but if compare_value is equal to the current RTC ticks value, that is compare_value == common_rtc_32bit_ticks_get(), this condition will be false and an invalid value will be written to CC register. Was that intentional? That new condition might well be replaced with: if (compare_value + 1 == closest_safe_compare).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you are right. It should have been <= 2 in the comparison. However, the new 5.9 tickers are about to land so I don't think we should fix this.

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.

6 participants