← index #12696PR #8341
Related · high · value 2.045
QUERY · ISSUE

stm32h5: stop/standby mode reset_cause not reported

openby renestraubopened 2023-10-15updated 2023-10-24
bugport-stm32

machine.reset_cause() reports 0 instead of 4 when system starts from stop or standby mode.

MicroPython v1.20.0-288-g3a153d92f-dirty on 2023-10-15; NUCLEO_H563ZI with STM32H563ZI
Type "help()" for more information.

The fix is to to add the following in void machine_init(void)

#elif defined(STM32H5)
if (PWR->PMSR & PWR_PMSR_STOPF || PWR->PMSR & PWR_PMSR_SBF) {
    // came out of standby or stop mode
    reset_cause = PYB_RESET_DEEPSLEEP;
    PWR->PMCR |= PWR_PMCR_CSSF;
} else

A PR will follow in the next days.

CANDIDATE · PULL REQUEST

stm32wb55/machine: Add deepsleep support to reset_cause().

closedby andrewleechopened 2022-02-22updated 2022-05-30
port-stm32

(no description)

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