sys/ztimer: convert clock do not require pm#16573
Merged
fjmolinas merged 1 commit intoRIOT-OS:masterfrom Jun 28, 2021
Merged
Conversation
Contributor
Author
|
this could also be achieved by having |
Contributor
Author
|
closed and reopend to trigger github actions that failed due to partial github failure |
a884fb6 to
6c452d5
Compare
avoid blocking and unblocking of power_mode 0 for convert clocks
6c452d5 to
a6a53c9
Compare
Contributor
|
This would be great to get in for the release, maybe someone could test as the code looks OK. ping @vincent-d @jue89 @fjmolinas |
fjmolinas
approved these changes
Jun 28, 2021
Contributor
fjmolinas
left a comment
There was a problem hiding this comment.
ACK, I was able to reproduce the test procedure (checking the mode value in gdb)
(gdb) p ZTIMER_SEC->block_pm_mode
$1 = 255 '\377'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
avoid blocking and unblocking of power mode 0 for convert clocks
@vincent-d identified in #15911 that pm should be done in base clock which was implemented in the huge ztimer auto init overhaul, but it was lacking the not blocking and not unblocking of #15911 for convert clocks which by default are set to 0 (un)blocking that pm
this removes that flaw
in contrast to my comment in #15911
ztimer/convert_muldiv64.candztimer/convert_shift.cdo not need modification since they call the init ofztimer/convert.cContribution description
this add setting convert clocks to require no pm (the base clock should have the pm blocking setup correctly)
Testing procedure
have hardware that operates with pm_mode 0 active, check the power consumption while you expect it sleeping, check if it wakes up when required.
i don't have such a setup (stm loses most of their mem with pm 0), but would @vincent-d and maybe @jue89 to have.
while one may not be able to test the effect it should be possible to check what this does by:
build and flash
tests/ztimer_xsecwithUSEMODULE=pm_layeredto your favorite board andmake debug(gdb) b mainon a second console
make termand startHelp: Press s to start test, r to print it is ready->[s] and [return]back to the first console and see
ante patch ->
$n = 0 '\000'means block an unblock pm 0 what ZTIMER_SEC should not dopost patch ->
$n = 255 '\377'means do not do any pm thing for ZTIMER_SEC ✔️Issues/PRs references
fixes what is left of #15911
I think this should be added to the ztimer project