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

Nuvoton: Fix Greentea test common_tickers failed #8030

Merged
merged 4 commits into from Sep 21, 2018

Conversation

Projects
None yet
6 participants
@ccli8
Contributor

ccli8 commented Sep 7, 2018

Description

This PR tries to fix mbed-os-tests-mbed_hal-common_tickers test failed, especially on Nuvoton targets:

  1. Redeem from missing go-off ticker interrupt when us/lp ticker layers are uninstalled
  2. Disable ticker interrupt which would interfere with fire_interrupt speed test
  3. Enlarge test period to avoid timeout error

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change

@0xc0170 0xc0170 requested review from mprse and ARMmbed/mbed-os-hal Sep 7, 2018

ccli8 added some commits Aug 8, 2018

[Nuvoton] Fix spurious us_ticker/lp_ticker interrupts
If us_ticker/lp_ticker is scheduled and then the interrupt is disabled, the originally scheduled
interrupt may still become pending. If this occurs, then an interrupt will fire twice on the next
call to us_ticker_set_interrupt/lp_ticker_set_interrupt - once immediately and then a second time
at the appropriate time.

This patch prevents the first interrupt by clearing interrupts in
us_ticker_set_interrupt/lp_ticker_set_interrupt before calling NVIC_EnableIRQ.
[Nuvoton] Synchronize us_ticker to lp_ticker
This is to make implementations of us_ticker/lp_ticker consistent.

@ccli8 ccli8 force-pushed the OpenNuvoton:nuvoton_fix_common_tickers_fail branch from 55284b8 to 9a003fc Sep 10, 2018

@ccli8

This comment has been minimized.

Contributor

ccli8 commented Sep 10, 2018

I do rebase and push some commits for Nuvoton targets:

  1. Fix spurious us_ticker/lp_ticker interrupts
  2. Fix lp_ticker_free cannot pass speed test

@ccli8 ccli8 changed the title from Fix Greentea test common_tickers failed to Nuvoton: Fix Greentea test common_tickers failed Sep 10, 2018

@mprse

mprse approved these changes Sep 10, 2018

Approved test changes.

@cmonr cmonr requested a review from c1728p9 Sep 10, 2018

@c1728p9

I left comments about some code which is unnecessary with #7524. Otherwise this PR looks good.

* the armed alarm won't go off until another ticker interrupt goes off. Manually firing one ticker interrupt
* can alleviate the issue.
*/
us_ticker_fire_interrupt();

This comment has been minimized.

@c1728p9

c1728p9 Sep 17, 2018

Contributor

This call to us_ticker_fire_interrupt should no longer be needed with the fix #7524. The call to ticker_resume earlier in this function should restart the common ticker layer.

This comment has been minimized.

@ccli8

ccli8 Sep 18, 2018

Contributor

@c1728p9 I remove the unnecessary code with #7524 in 4888ff2.

@@ -563,13 +579,16 @@ utest::v1::status_t lp_ticker_teardown(const Case *const source, const size_t pa
ticker_resume(get_lp_ticker_data());
osKernelResume(0);
/* Redeem from missing go-off ticker interrupt (same as us ticker above) */
lp_ticker_fire_interrupt();

This comment has been minimized.

@c1728p9

c1728p9 Sep 17, 2018

Contributor

This call to us_ticker_fire_interrupt should no longer be needed with the fix #7524. The call to ticker_resume earlier in this function should restart the common ticker layer.

This comment has been minimized.

@ccli8

ccli8 Sep 18, 2018

Contributor

@c1728p9 Fixed as above.

Fix Greentea test common_tickers failed
1. Disable ticker interrupt which would interfere with fire_interrupt speed test
2. Enlarge test period to avoid timeout error

@ccli8 ccli8 force-pushed the OpenNuvoton:nuvoton_fix_common_tickers_fail branch from 9a003fc to 4888ff2 Sep 18, 2018

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

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Sep 19, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Sep 19, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Sep 20, 2018

Failures were due to a faulty board providing a false enumerated device.
/morph test

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Sep 21, 2018

/morph test

@mbed-ci

This comment has been minimized.

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Sep 21, 2018

@0xc0170 0xc0170 merged commit ab882c3 into ARMmbed:master Sep 21, 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
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 9159 cycles (+24 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

@ccli8 ccli8 deleted the OpenNuvoton:nuvoton_fix_common_tickers_fail branch Oct 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment