Add support for entering Standby mode#28
Merged
Conversation
`wait_for_irq` originally supported EXTI interrupts, which can wake the microcontroller up from Stop mode and above. Now it also supports the RTC interrupt, which can wake the microcontroller up from all modes, including Standby. Restricting the support power modes with the `SupportedPowerModes` trait no longer makes sense.
It seems logical that this would be necessary to ensure the correct low-power mode is entered. I'm not sure if it's actually needed in practice, but ARM documentation (for example [1], [2]) mentions this. [1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0321a/BIHHFHJB.html [2] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0321a/BIHEDAAF.html
I don't see why this would be necessary, but I've been having problem getting wakeup from Standy mode to work for a while now, and I'm getting desperate. Only disabling the write protection when requires is like the documentation and other implementation handle it, so I'd like to be on the safe side and do that too.
This flag needs to be cleared before Stop mode can be entered. Things worked out fine in my testing so far, because I never tested Stop mode in a situation WUF would have been set in.
Leaving the flag set could interfere with any later attempts to enter low-power modes.
This was referenced Aug 16, 2019
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.
Adds support for entering Standby mode, as well as wake-up from Standby mode via RTC. Also includes a bunch of fixes and cleanups of earlier work.
cc @lthiery