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

tests-mbed_hal-lp_ticker: change implementation of the delay before deep-sleep. #7494

Merged
merged 1 commit into from Jul 13, 2018

Conversation

Projects
None yet
6 participants
@mprse
Member

mprse commented Jul 12, 2018

Description

This is fix for issue reported in PR #7419 (comment)

Serial buffer must be flushed before entering deep sleep mode. In the test this is done by the additional delay which is implemented on the busy loop which decrements given value down to 0 (void wait_cycles(volatile unsigned int cycles)).
This solution is not appropriate since it is very target specific and the cycles value has been already increased few times. Additionally very big number of loop cycles which is suitable for fast targets may take much longer on slower boards and results in test timeout.
It has been verified that 20ms is sufficient delay for the green-tea transmission. In this test we cannot simply use wait_ms(20) since this potentially may put board to sleep and wake up using lp ticker. The test re-initialzies the lp ticker(disables ticker interrupt) and this operation may break the schedule and time tracing by the upper layer. But we can use us ticker which is not affected by this test. The solution is to add a delay routine based on busy loop and us ticker only. This way are able to wait exactly 20 ms.

Pull request type

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

@mprse mprse force-pushed the mprse:lp_ticker_deep_sleep_delay_fix branch from e6a3bef to 10e53b0 Jul 12, 2018

tests-mbed_hal-lp_ticker: change implementation of the delay before d…
…eep-sleep.

Serial buffer must be flushed before entering deep sleep mode. In the test this is done by the additional delay which is implemented on the busy loop which decrements given value down to 0 (`void wait_cycles(volatile unsigned int cycles)`). This solution is not appropriate since it is very target specific and the cycles value has been already increased few times. Additionally very big number of loop cycles which is suitable for fast targets may take much longer on slower boards and results in test timeout.
It has been verified that 20ms is sufficient delay for the green-tea transmission. In this test we cannot simply use `wait_ms(20)` since this potentially may put board to sleep and wake up using lp ticker. The test re-initialzies the lp ticker(disables ticker interrupt) and this operation may break the schedule and time tracing by the upper layer. But we can use us ticker which is not affected by this test. The solution is to add a delay routine based on busy loop and us ticker only. This way are able to wait exactly 20 ms.

@mprse mprse force-pushed the mprse:lp_ticker_deep_sleep_delay_fix branch from 10e53b0 to 832e8b3 Jul 12, 2018

@0xc0170 0xc0170 requested a review from ARMmbed/mbed-os-test Jul 12, 2018

@OPpuolitaival

This comment has been minimized.

Contributor

OPpuolitaival commented Jul 12, 2018

Cannot review, I don't know enough where this is affected

@studavekar

the number of cycles been replaced with definite time 👍

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jul 13, 2018

/morph build

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Jul 13, 2018

@mbed-ci

This comment has been minimized.

mbed-ci commented Jul 13, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr cmonr merged commit def1ef2 into ARMmbed:master Jul 13, 2018

14 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/astyle Passed, 791 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9586 cycles (+726 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 9960B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details

@0xc0170 0xc0170 removed the needs: CI label Jul 13, 2018

pan- pushed a commit to pan-/mbed that referenced this pull request Aug 22, 2018

Merge pull request ARMmbed#7494 from mprse/lp_ticker_deep_sleep_delay…
…_fix

tests-mbed_hal-lp_ticker: change implementation of the delay before deep-sleep.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment