← index #12696Issue #11392
Related · high · value 2.320
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 · ISSUE

`machine.reset_cause()` always returns 0 on Arduino Portenta H7

closedby victorallumeopened 2023-05-01updated 2023-05-02
bug

No matter what reset is actually done (I've tried soft, hard, and watchdog), machine.reset_cause() always returns 0. Reading stm.mem32[stm.RCC + stm.RCC_RSR] also returns 0, which I think is expected since modmachine.c tells this register to reset (via RCC->RCC_SR |= RCC_SR_RMVF;) but even if I comment out this line and recompile, the RCC_RSR register still always returns 0. Is it possible the bootloader or other core of the H747 is clearing this before micropython has a chance to?

Have tested on 1.19 and 1.20.

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