QUERY · ISSUE
STM32 sleep wake time problem
port-stm32
rtc.wakeup(ms)
machine.lightsleep(ms)
Do these two functions use the same wake-up source?
What is the maximum value of ms?
CANDIDATE · ISSUE
stm32: rtc.wakeup() freezes the system on F0 and L4 MCUs
bugport-stm32
I tried this on a pyboard and it flashes the LED. Same program on the STM32L476_DISC port set the LED and freezes. Adapted it for the NUCLEO_F093RC and it also freezes.
Did anyone tested this functionality or can test this to confirm this behaviour?
import pyb
rtc = pyb.RTC() # rtc is running
def lpdelay(ms):
rtc.wakeup(ms)
pyb.stop()
rtc.wakeup(None)
led = pyb.LED(1)
while True:
led.on()
pyb.delay(1000)
led.off()
pyb.delay(1)
lpdelay(1000)
For the NUCLEO_F093RC port using machine instead of pyb
import pyb, time, machine
rtc=pyb.RTC()
def lpdelay(ms):
rtc.wakeup(ms)
machine.sleep()
rtc.wakeup(None)
led = pyb.LED(1)
while True:
led.on()
time.sleep_ms(1000)
led.off()
time.sleep_ms(1)
lpdelay(1000)