From 49b8579bcd1bd2dc914ba89a7ed94e302ed2f900 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 17 Jan 2022 17:14:31 -0600 Subject: [PATCH] Request UF2 bootloader when resetting using the 'serial trick' --- ports/espressif/supervisor/port.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index c8cb344aae..d4c935d71d 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -51,6 +51,8 @@ #include "supervisor/background_callback.h" #include "supervisor/memory.h" #include "supervisor/shared/tick.h" +#include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/RunMode.h" #include "shared-bindings/rtc/__init__.h" #include "peripherals/rmt.h" @@ -263,6 +265,7 @@ void reset_port(void) { } void reset_to_bootloader(void) { + common_hal_mcu_on_next_reset(RUNMODE_UF2); esp_restart(); }