-
Notifications
You must be signed in to change notification settings - Fork 1.3k
STM32: Alarms and sleep #4388
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
STM32: Alarms and sleep #4388
Conversation
I'm confused; is this problem now gone? |
The nRF52 sleep PR does have a true light sleep, so I think we could keep it. But it sounds like you're thinking there might be a "medium sleep" feature, which does take down certain peripherals and things like wifi. |
@dhalbert sorry Dan, I hadn't updated the original PR message since I fixed my issues. My original thinking was that the term "light sleep" might be better suited to more power saving tasks, since the ESP32S2 light sleep saves no power compared to I wouldn't be opposed to nailing down some official guidelines before I get into the RP2040 stuff. Each port defines light and deep sleep to mean different things so we're on our own for defining exactly what we want the terms to mean. As far as I understand things:
NRF I'm less confident defining one way or the other, you would know in more detail. Deep sleep is pretty similar across all cases, so we can just define that as power gating and leave it at that. For light sleep we could do one of a couple definitions:
We could potentially make either of the latter two options into "medium sleep" if the power savings ended up being significant. It might be justifiable if they'd lead to significant weeks/months of runtime on a single battery charge without losing collections of active data in RAM. But if I can get some good power savings out of regular light sleep with manual power gating, I don't think it'll be very high priority to spend extra effort just to turn off the HSE. I think this is what Scott was getting at after the meeting. |
I've re-tested this with all the new 7.0.0 and NRF stuff merged in - all sleep types and modules are still working. |
H7 compatibility problems in port.c and peripherals/exti NRF build failures due to new use of const for PinAlarm pin objects Isolated board flash overage on blackpill_with_flash, remove audio modules
@hierophect Could you merge from upstream and fix the conflicts and also look at the few failed builds (looks like a missing include?)? |
Implmements missed pre-commit changes for all files, and fixes links broken by cleanup in #4698
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.
Sorry for the delay in reviewing this.
frozen/Adafruit_CircuitPython_HID
and Adafruit_CircuitPython_SimpleMath
should not be changing. They are probably behind the current versions. You might want to merge from upstream and then recheck these. You may need to pull them ahead by hand; make them match what is in main
.
Do a make translate
after you merge from upstream as well.
Thanks for all the commenting.
I did not test this on hardware, but I know you've done that extensively. I don't know the STM well enough to vet the details of the wakeup pin handling, etc., so I also did not check that. Again, your testing is the proof.
Yes, the eternal "I forgot to update submodules after merging" problem, that I will never not forget to do. I should figure out how to tack on a shell script or something to auto-run it or post a warning or something after a |
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.
Changes look good! Thanks - we'll merge now and you can then proceed on the API cleanup, etc.
This PR adds light and deep sleep to the STM32 port. It makes minor changes to the internal APIs to match other pin-using modules, and includes changes to the STM32 peripheral structure to support new EXTI and RTC functionality.
Implemented features:
/peripherals
module/peripherals
moduleconst
, matching DigitalIO and similar modules.The STM32 does not have a specialized Touch module, so TouchAlarm is not implemented. SleepMemory is not currently included, but will be in a follow-up PR.