-
Notifications
You must be signed in to change notification settings - Fork 3k
tests tickers: adapt ticker_interrupt_test() test case for high frequency tickers #12218
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
Conversation
@mprse, thank you for your changes. |
CI started |
Test run: SUCCESSSummary: 5 of 5 test jobs passed |
@mprse Who else should review this one? |
|
||
/* Skip timeout if less than max allowed execution time of set_interrupt() - 20 us */ | ||
if (TICKS_TO_US(ticker_timeout[i], p_ticker_info->frequency) < (MAX_FUNC_EXEC_TIME_US + DELTA_FUNC_EXEC_TIME_US)) { | ||
continue; |
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.
There is no extra print or something else ?
This test could go into this continue line without any real test...?
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.
Good point! Added check at the end of the test case to ensure that at least 3 timeouts were tested.
Thanks for the improvement, @mprse |
…e for high frequency tickers On some targets with very fast counters used for us ticker (e.g. 26 MHz) tested interrupt delays provided in the ticker_timeout array may be too short (execution of the set_interrupt() function takes longer than the tested delay). We will skip tested ticker delay if the delay is less than assumed max set_interrupt() function execution time (20 us). Also, the test array will be extended.
e98a9d6
to
db8e776
Compare
@andrewc-arm Can you review this one? |
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 don't deeply understand the test code logic.
But as long as the test is extended and pass my partner's target board and other's boards then I am OK.
@@ -53,7 +53,7 @@ extern "C" { | |||
#define TICKER_100_TICKS 100 | |||
#define TICKER_500_TICKS 500 | |||
|
|||
#define MAX_FUNC_EXEC_TIME_US 30 | |||
#define MAX_FUNC_EXEC_TIME_US 20 |
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.
@mprse
Could you kindly elaborate on this? I thought we wanted increase instead of decrease the time taken on execution.
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.
Yes, I found this while adding this patch and fixed as a part of it. According to the requirements:
Lines 91 to 92 in 40b7901
* * The ticker operations ticker_read, ticker_clear_interrupt, ticker_set_interrupt and ticker_fire_interrupt | |
* take less than 20us to complete - Verified by ::ticker_speed_test |
So this value should be 20 us
. This should not have an impact on S111
target since it is very fast. I also tested this with a few other targets with positive results.
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.
Thank you. I am good with the change. BTW, I tested the 10 times for S5JS100 timer and they all passed. There is no more random failure due to timing.
CI started |
Test run: SUCCESSSummary: 5 of 5 test jobs passed |
Summary of changes
On some targets with very fast counters used for us ticker (e.g. 26 MHz) tested interrupt delays provided in the
ticker_timeout
array may be too short (execution of theset_interrupt()
function takes longer than the tested delay).We will skip tested ticker delay if the delay is less than assumed max
set_interrupt()
function execution time (20 us
).Also, the test array will be extended.
Tested on:
K64F
,NUCLEO_F429ZI
,NRF52840_DK
.Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers