summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/stm32/main.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/ports/stm32/main.c b/ports/stm32/main.c
index f19dac0e7..7f8ee84fd 100644
--- a/ports/stm32/main.c
+++ b/ports/stm32/main.c
@@ -552,6 +552,11 @@ void stm32_main(uint32_t reset_mode) {
MP_STATE_PORT(pyb_uart_obj_all)[MICROPY_HW_UART_REPL - 1] = &pyb_uart_repl_obj;
#endif
+ #if !MICROPY_HW_USES_BOOTLOADER
+ // check if user switch held to select the reset mode
+ reset_mode = update_reset_mode(1);
+ #endif
+
soft_reset:
#if defined(MICROPY_HW_LED2)
@@ -564,11 +569,6 @@ soft_reset:
led_state(3, 0);
led_state(4, 0);
- #if !MICROPY_HW_USES_BOOTLOADER
- // check if user switch held to select the reset mode
- reset_mode = update_reset_mode(1);
- #endif
-
// Python threading init
#if MICROPY_PY_THREAD
mp_thread_init();
@@ -776,5 +776,8 @@ soft_reset_exit:
gc_sweep_all();
+ // Set reset_mode to normal boot.
+ reset_mode = 1;
+
goto soft_reset;
}