QUERY · ISSUE
stmhal: WDT hangs after programming
bugport-stm32
I discovered an interesting quirk related to the IWDG.
If I program my pyboard using pydfu, then trying this in the REPL immediately afterwards hangs:
>>> wdt = machine.WDT(0, 5000)
By hangs, I mean it never returns the REPL. I added some debug prints and it seems to stuck in the IWDG->SR & 1 loop and the value of SR is 3.
If I hit the RESET button, then the wdt = machine.WDT(0, 5000) works exactly as expected.
CANDIDATE · PULL REQUEST
stmhal: Move debug UART repl to after uart_init0 call.
Move the debug UART repl code to after uart_init0 call.
Otherwise, if you enable this code by changing #if 0 to #if 1, then as soon as you type anything on the uart repl, the pyboard hangs.