Adding Wake up Pins configuration to deepsleep for STM32 / pyboard-d
Posted: Wed Sep 23, 2020 9:47 am
Hi Everyone,
Following my question here viewtopic.php?f=20&t=9056
I dig into the firmware code and found the missing bits.
I now have a patch that allows a user to call deepsleep with the PINS parameters and successuflly tested it on a SF6W board for the X1 pins.
All these work the way they should
machine.deepsleep([time_ms | 0 for infinity], [WKUP_PINS_X1/X18], [WKUP_PINS_X1/X18_RISING/FALLING])
# will sleep forever
machine.deepsleep()
# will wakeup in 20 seconds
machine.deepsleep(20000)
# will wakeup in 10 second unless there is a rising on X1
machine.deepsleep(10000, machine.WKUP_X1, machine.WKUP_X1_RISING)
# will sleep forerver unless there is a rising on X1
machine.deepsleep(0, machine.WKUP_X1, machine.WKUP_X1_RISING)
# will sleep forerver unless there is a falling on X1
machine.deepsleep(0, machine.WKUP_X1, machine.WKUP_X1_FALLING)
Now I know that machine is for all boards and that it means that it can't be added to the core code without rework for the other platform.
I also now it will require more test for the X18 pin. but for the moment I don't know how to reach it
I'm posting here because I don't know the next steps and I would love to discuss all this.
BTW: thanks for the amazing job you've been doing so far
Following my question here viewtopic.php?f=20&t=9056
I dig into the firmware code and found the missing bits.
I now have a patch that allows a user to call deepsleep with the PINS parameters and successuflly tested it on a SF6W board for the X1 pins.
All these work the way they should
machine.deepsleep([time_ms | 0 for infinity], [WKUP_PINS_X1/X18], [WKUP_PINS_X1/X18_RISING/FALLING])
# will sleep forever
machine.deepsleep()
# will wakeup in 20 seconds
machine.deepsleep(20000)
# will wakeup in 10 second unless there is a rising on X1
machine.deepsleep(10000, machine.WKUP_X1, machine.WKUP_X1_RISING)
# will sleep forerver unless there is a rising on X1
machine.deepsleep(0, machine.WKUP_X1, machine.WKUP_X1_RISING)
# will sleep forerver unless there is a falling on X1
machine.deepsleep(0, machine.WKUP_X1, machine.WKUP_X1_FALLING)
Now I know that machine is for all boards and that it means that it can't be added to the core code without rework for the other platform.
I also now it will require more test for the X18 pin. but for the moment I don't know how to reach it
I'm posting here because I don't know the next steps and I would love to discuss all this.
BTW: thanks for the amazing job you've been doing so far