-
Notifications
You must be signed in to change notification settings - Fork 513
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
WKP pin should not be enabled as a wakeup source unconditionally for STOP mode #948
Conversation
…STOP mode on STM32F2
Could you write a test to validate the behavior? |
I'm uncertain if we should change the default behavior (so A7 is no longer available as a wakeup source after stop mode sleep.) While that would be the simplest fix, it may break existing applications, although in the long term I feel this is the best solution. We could provide documentation for when A7 wakeup is required then |
How about we go with the second approach: save the A7 configuration, call |
ok, if we can preserve the configuration, that's also a good approach, although I do feel using WKP in stop mode is unexpected, and I can imagine situations where this might cause unexpected wakeups, depending upon what else A7 is being used for. I feel your initial PR is best - remove wakeup by default, and let application developers add this if they need it. |
Is this changing documented behavior so that WKP will no longer wake a device up from sleep? https://docs.particle.io/reference/firmware/photon/#backup-ram-sram-
https://docs.particle.io/datasheets/photon-datasheet/#pin-description
Update My question still stands: are users depending on the fact that WKP will wake up a device in STOP mode? |
This is stop mode sleep, not deep sleep. As far as I know, being able to wake up stop mode sleep from A7/WKP is undocumented (and imho unepxected) behavior. Stop mode sleep is |
I appears that the WKP pin doesn't wake the micro in STOP mode So I'd say this is ready to merge. |
Correct, according to the reference manual WKP doesn't wakeup CPU from STOP mode:
This PR mainly fixes the issue that WKP pin is fixed in INPUT_PULLDOWN configuration after exiting STOP mode and its configuration cannot be changed anymore. |
Just to be awkward 😉 https://docs.particle.io/reference/firmware/photon/#sleep-sleep-
Easily fixed, but contradicts this statement made earlier
|
What I meant was that the WKP pin isn't documented to function in addition to the specified wakeup pin in stop mode. (Currently the code is enabling WKP as a deep-sleep wakeup source, for stop mode sleep.) So, |
I'm still having the issue while using the AssetTracker WakeOnMove example.
When I used the 0.5.3 electreon firmware version it stopped waking up the device after an hour. |
Fixes #938
Confirmed that after exiting STOP mode with some other pin specified as a wakeup source, WKP pin retains its configuration (e.g. tone() continues working).
If WKP is specified as wakeup source for System.sleep(), its pinMode will be changed to either INPUT, INPUT_PULLDOWN or INPUT_PULLUP depending on trigger condition. The pin will have to be reconfigured.
Doneness: