Skip to content
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

Add support for entering Standby mode #28

Merged
merged 8 commits into from
Aug 16, 2019
Merged

Add support for entering Standby mode #28

merged 8 commits into from
Aug 16, 2019

Conversation

hannobraun
Copy link
Contributor

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

`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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants