Rework CMAC sleep calculations#3049
Draft
andrzej-kaczmarek wants to merge 4 commits intoapache:masterfrom
Draft
Conversation
a40f92e to
01fe8ae
Compare
We should calculate XTALRDY value assuming worst case which is the max possible RC32M frequency (32.6 MHz). If the actual frequency of RC32M is lower than 32.6 MHz, it will take longer time than set to mark xtal as settled which is still ok since we don't want xtal to be "settled" to early.
This adds helper to calculate number of lpclk ticks required for wakeup, i.e. wakeup fsm + xtal32m settle time. This can be then used to adjust sleep time.
In case RCX is enabled, we call lpclk enable from sysinit instead of system init.
82e5794 to
1c2f1e5
Compare
Sleep time calculation on CMAC assumed incorrectly that wakeup fsm uses lpclk but in fact RC32K is used so we need to take it into account. To make things easier to handle on CMAC side we will calculate wakeup time on M33 side and pass it to CMAC instead of XTAL32M settle time. This way we don't really need to care about how wakeup fsm is configured. It's now expected that M33 will take care of RC32K calibration and will calculate proper wakeup time based on wakeup fsm settings and XTAL32M settle time, and then notify CMAC on any change so we can recalculate our min sleep time.
1c2f1e5 to
742b87b
Compare
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.
No description provided.