-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
modify deepsleep to allow wakeup on X1 or X18 on a STM32F7 (SF2/3/6W) #6482
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
base: master
Are you sure you want to change the base?
Conversation
…F2/6W example machine.deepsleep([time_ms | 0 for infinity], [WKUP_PINS_X1/X18], [WKUP_PINS_X1/X18_RISING/FALLING]) machine.deepsleep() machine.deepsleep(20000) machine.deepsleep(10000, machine.WKUP_X1, machine.WKUP_X1_RISING) machine.deepsleep(0, machine.WKUP_X1, machine.WKUP_X1_RISING) machine.deepsleep(0, machine.WKUP_X1, machine.WKUP_X1_FALLING) Prior to this commit only the timer wakeup would work for a deepsleep. This was the case because for the STM32F7 all wakeup pins were cleared out before entering in deepsleep this commit is a work in progress for technical discussions.
[EDITED] It may be worth also considering a Python solution as speed is not an issue. Alas, as you have identified, a Python solution to X1 wakeup is currently not feasible because of this line. With that line commented out I have tested a Python solution which wakes on X1 or X18. |
Ok now we have a duplicate for this issue, which is good, it means that it will be solved one way or another. So now we need to discuss the solutions. Solution 1 (time based): PR 6482 (this one):
Both solution have advantages and drawbacks. Drawbacks: Solution 2: How can we have this discussion ? Duplicate: #6494 |
The latest release of my micropower repo requires only this #6494 small change to the firmware. It supports the Pyboard D in a way that has been in use for some time on the Pyboard 1.x. User code will only need minor changes to migrate to the D series. Further this very simple PR doesn't preclude supporting micropower functions in C. It merely provides to the D series functionality available on the Pyboard 1.x. In my opinion it is a bug fix. I see no conflict between the different approaches. My solution exists now and (with this bug fix) works on the D series. If there is a case for a C solution I see no reason why this cannot be developed independently. |
this includes patch for PR6494 and allows both patch to co-exists Users can then choose between 2 ways machine.deepsleep([ms]) pyb.standby([ms], [wakeup Pins X1|X18], [wakeup trigger FALLING|RISING]) -- tested 1.13 machine.deepsleep(2000) # OK machine.deepsleep(5000) # OK machine.deepsleep(10000) # OK machine.deepsleep(20000) # OK machine.deepsleep() # OK waited 2 minutes -- tested new firmware machine.deepsleep(2000) # OK machine.deepsleep(5000) # OK machine.deepsleep(10000) # OK machine.deepsleep(20000) # OK machine.deepsleep() # OK waited 2 minutes pyb.standby(0) # OK waited for 2 minutes pyb.standby(2000) # OK pyb.standby(5000) # OK pyb.standby(10000) # OK pyb.standby(20000) # OK pyb.standby() # OK waited for 2 minutes pyb.standby(0, pyb.WKUP_X1, pyb.WKUP_X1_FALLING) # OK wake up on interrupt within 10 sec pyb.standby(2000, pyb.WKUP_X1, pyb.WKUP_X1_FALLING) # OK wakes up after 2sec pyb.standby(5000, pyb.WKUP_X1, pyb.WKUP_X1_FALLING) # OK wakes up after 5 sec pyb.standby(10000, pyb.WKUP_X1, pyb.WKUP_X1_FALLING) # OK wakes up after 10 sec and wakes up on interrupt within 10 sec pyb.standby(20000, pyb.WKUP_X1, pyb.WKUP_X1_FALLING) # OK wakes up after 20 sec and wakes up on interrupt within 20 sec pyb.standby(0, pyb.WKUP_X18, pyb.WKUP_X18_FALLING) # OK wake up on interrupt within 10 sec pyb.standby(2000, pyb.WKUP_X18, pyb.WKUP_X18_FALLING) # OK wakes up after 2sec pyb.standby(5000, pyb.WKUP_X18, pyb.WKUP_X18_FALLING) # OK wakes up after 5 sec pyb.standby(10000, pyb.WKUP_X18, pyb.WKUP_X18_FALLING) # OK wakes up after 10 sec and wakes up on interrupt within 10 sec pyb.standby(20000, pyb.WKUP_X18, pyb.WKUP_X18_FALLING) # OK wakes up after 20 sec and wakes up on interrupt within 20 sec -- TO TEST pyb.standby(0, pyb.WKUP_X1 | pyb.WKUP_X18, pyb.WKUP_X1_FALLING | pyb.WKUP_X18_FALLING) # machine.deepsleep with upower.py
So here is V2, where I had to cut the link between pyb.standby and machine.deepsleep to keep PR6494 I would love to have the opinion of a maintainer, so that I know if there's any good in pursuing into this direction |
This is an automated heads-up that we've just merged a Pull Request See #13763 A search suggests this PR might apply the STATIC macro to some C code. If it Although this is an automated message, feel free to @-reply to me directly if |
…F2/6W
example
machine.deepsleep([time_ms | 0 for infinity], [WKUP_PINS_X1/X18], [WKUP_PINS_X1/X18_RISING/FALLING])
machine.deepsleep()
machine.deepsleep(20000)
machine.deepsleep(10000, machine.WKUP_X1, machine.WKUP_X1_RISING)
machine.deepsleep(0, machine.WKUP_X1, machine.WKUP_X1_RISING)
machine.deepsleep(0, machine.WKUP_X1, machine.WKUP_X1_FALLING)
Prior to this commit only the timer wakeup would work for a deepsleep.
This was the case because for the STM32F7 all wakeup pins were cleared out before
entering in deepsleep
this commit is a work in progress for technical discussions.