-
Notifications
You must be signed in to change notification settings - Fork 3k
OS timer uses LPTICKER by default, then USTICKER #12988
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
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.
Seems like a good idea to me. No strong feelings on the error
.
platform/source/mbed_os_timer.cpp
Outdated
#else | ||
MBED_ASSERT("OS timer not available - check MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER" && false); | ||
return NULL; | ||
error("OS timer not available - check MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER"); |
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 think this should probably be MBED_ERROR
these days, as unwieldy as it is. I suppose it makes sense to not be an assert though - this path can't produce a functioning image in any way, and it will be clearer than just a null pointer exception.
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.
Advantage if this change is to see the error message in the console!
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.
looks like error is still valid, although would assume adding a new error would use MBED_ERROR
I did a search for the config option, and there's one more place to change - I can see a compile time error here that would need to be removed:
The other error there would still be valid. Not sure why you don't see that in testing. Non-RTOS build? |
Issue comes with targets which don't support LPTICKER in baremetal. |
And that don't have MBED_TICKLESS set? Okay, I think I grasp the combinations now. That timer stuff is used either by RTOS builds with MBED_TICKLESS, or by bare metal builds if you use RTOS API timing functions. Bare metal is inherently "tickless" - and that's why you see it tripping up without In the RTOS case, that stuff needs to work, and not having it correct may as well be a compile error, which is what we see in mbed_rtx_idle. In the bare metal case, it should be fine up until you use a timing function, so the run-time error in |
Thinking back, I seem to recall there was a school of thought that That error I suggested be removed is enforcing that. Don't think I buy the argument (if I'm recalling it correctly). Tickless RTOS without deep sleep is still a power optimisation, if a more minor one. No need to wake 1000 times a second. |
What about a target without LPTICKER (so no TICKLESS) |
The following PR removes the need to override it: ARMmbed/mbed-os#12988 Signed-off-by: Hugues Kamba <[email protected]>
Not sure what you're asking. This PR as it stands makes the bare-metal mode work automatically regardless of the If we want the RTOS tickless to not be automatic, leave the I think some of the flagging may not make total sense at this point. Originally It might have made more sense for (I believe tickless-from-us-ticker should perform fine on all platforms). It's possible the bare-metal is being excessively optimistic, compared to the RTOS, by wanting to use lpticker "by default". There's been a mixture of "use lpticker by default if available" and "use lpticker only if explicitly enabled" in various components in the past. The "only if explictly enabled" was usually due to (a) latency compensation worries (which we can deal with) or (b) unhappiness at being regularly reprogrammed 1/1000 times a second. Neither of which is necessarily a problem for bare-metal use. |
platform/source/mbed_os_timer.cpp
Outdated
#else | ||
MBED_ASSERT("OS timer not available - check MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER" && false); | ||
return NULL; | ||
error("OS timer not available - check MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER"); | ||
#endif | ||
//os_timer->setup_irq(); |
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.
Can we also remove this commented out code?
Only my suggested
I'm not sure I'd advocate that now. Flipping default state of either option is likely to confuse apps - it's the sort of thing people do mess with trying to get platforms to work. I'd limit the adjustment to removing that |
I think I will close my PR when I see Kevin's one :-) |
Not planning one - I don't think significant changes to the way the whole thing works at this point are a good idea. Just that |
308a236
to
42466f0
Compare
42466f0
to
bc5fa43
Compare
@jeromecoutant Changes look good. Can you add a reason for this change - details to the commit message? to cover what was discussed here? |
This PR makes the bare-metal mode work automatically regardless of the tickless-from-us-ticker setting - in non RTOS mode - and in RTOS tickless mode
bc5fa43
to
a7c9601
Compare
Pull request has been modified.
Done |
Could we start CI ? |
I'll start running CI soon for all PRs ready for CI |
CI started |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
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.
already approved by others as well
This PR does not contain release version label after merging. |
The following PR removes the need to override it: ARMmbed/mbed-os#12988 Signed-off-by: Hugues Kamba <[email protected]>
Summary of changes
Discussion started in #12663 (comment)
Idea is to use lpticker by preference if available, else usticker.
@kjbracey-arm
@LMESTM
Impact of changes
Avoid to define "tickless-from-us-ticker" for each target that doesn't support LPTICKER
Migration actions required
Documentation
Pull request type
Test results
Reviewers