-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Nuvoton: Fix Greentea test common_tickers failed #8030
Conversation
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.
This is to make implementations of us_ticker/lp_ticker consistent.
55284b8
to
9a003fc
Compare
I do rebase and push some commits for Nuvoton targets:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved test changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@c1728p9 Fixed as above.
1. Disable ticker interrupt which would interfere with fire_interrupt speed test 2. Enlarge test period to avoid timeout error
9a003fc
to
4888ff2
Compare
/morph build |
Build : SUCCESSBuild number : 3108 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 2715 |
Test : FAILUREBuild number : 2897 |
Failures were due to a faulty board providing a false enumerated device. |
Test : FAILUREBuild number : 2914 |
/morph test |
Test : SUCCESSBuild number : 2917 |
Description
This PR tries to fix
mbed-os-tests-mbed_hal-common_tickers
test failed, especially on Nuvoton targets:Pull request type