← index #4716PR #12761
Related · high · value 5.754
QUERY · ISSUE

H743ZI sleep modes

openby orelmiopened 2019-04-23updated 2019-08-27
port-stm32

Hello,

I see that function machine_deepsleep has a TODO for STM32H7.

Please could you help me to implement the TODO ? I should do that but i need main guide lines.

Thanks

Aurélien

CANDIDATE · PULL REQUEST

ports/stm32h5: add sleep modes and RTC alarm wakeup

mergedby renestraubopened 2023-10-21updated 2023-11-03
port-stm32

This PR adds support for machine.lightsleep() and machine.deepsleep() for STM32H5. Wakeup is possible via RTC.alarm(). machine.reset_cause() reports the proper code when waking up from on of those.

r = RTC()
r.wakeup(5_000)
machine.deepsleep()

# System goes to sleep for 5 secs

# Wakes up via reset, all state is lost
MicroPython v1.20.0-288-g3a153d92f-dirty on 2023-10-21; NUCLEO_H563ZI with STM32H563ZI
Type "help()" for more information.

machine.reset_cause()
4
machine.DEEPSLEEP_RESET
4
i = 1
r = RTC()
r.wakeup(5_000)
machine.lightsleep()

# System goes to sleep for 5 secs

# Wakes up from Stop mode, state is retained

machine.reset_cause()
4
i
1

This PR fixes #12697

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied