Skip to content

Commit 2360143

Browse files
committed
ports/esp32: Add automatic bootloader handling for S2 and S3.
Enables support for the ESP standard DTR/RTS based reboot to bootloader. Switches from OTG to Serial/Jtag mode to workaround issue discussed in: espressif/arduino-esp32#6762 Signed-off-by: Andrew Leech <andrew@alelec.net>
1 parent 1b51db1 commit 2360143

File tree

17 files changed

+54
-14
lines changed

17 files changed

+54
-14
lines changed

ports/esp32/boards/ESP32_GENERIC_S3/sdkconfig.board

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
22
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
3-
CONFIG_ESPTOOLPY_AFTER_NORESET=y
43

54
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
65
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y

ports/esp32/boards/UM_FEATHERS2/sdkconfig.board

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
22
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
3-
CONFIG_ESPTOOLPY_AFTER_NORESET=y
43

54
CONFIG_SPIRAM_MEMTEST=
65

ports/esp32/boards/UM_FEATHERS2NEO/sdkconfig.board

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
22
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
3-
CONFIG_ESPTOOLPY_AFTER_NORESET=y
43

54
# LWIP
65
CONFIG_LWIP_LOCAL_HOSTNAME="UMFeatherS2Neo"

ports/esp32/boards/UM_FEATHERS3/sdkconfig.board

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
22
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
3-
CONFIG_ESPTOOLPY_AFTER_NORESET=y
43

54
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
65
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=

ports/esp32/boards/UM_NANOS3/sdkconfig.board

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
22
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
3-
CONFIG_ESPTOOLPY_AFTER_NORESET=y
43

54
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
65
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y

ports/esp32/boards/UM_PROS3/sdkconfig.board

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
22
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
3-
CONFIG_ESPTOOLPY_AFTER_NORESET=y
43

54
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
65
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=

ports/esp32/boards/UM_TINYS2/sdkconfig.board

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
22
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
3-
CONFIG_ESPTOOLPY_AFTER_NORESET=y
43

54
# LWIP
65
CONFIG_LWIP_LOCAL_HOSTNAME="UMTinyS2"

ports/esp32/boards/UM_TINYS3/sdkconfig.board

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
22
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
3-
CONFIG_ESPTOOLPY_AFTER_NORESET=y
43

54
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
65
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y

ports/esp32/boards/UM_TINYWATCHS3/sdkconfig.board

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
22
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
3-
CONFIG_ESPTOOLPY_AFTER_NORESET=y
43

54
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
65
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y

ports/esp32/modmachine.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,25 @@ static mp_int_t mp_machine_reset_cause(void) {
222222

223223
#if MICROPY_ESP32_USE_BOOTLOADER_RTC
224224
#include "soc/rtc_cntl_reg.h"
225+
#include "usb.h"
226+
#if CONFIG_IDF_TARGET_ESP32S2
227+
#include "esp32s2/rom/usb/usb_dc.h"
228+
#include "esp32s2/rom/usb/usb_persist.h"
229+
#include "esp32s2/rom/usb/chip_usb_dw_wrapper.h"
230+
#elif CONFIG_IDF_TARGET_ESP32S3
231+
#include "esp32s3/rom/usb/usb_dc.h"
232+
#include "esp32s3/rom/usb/usb_persist.h"
233+
#include "esp32s3/rom/usb/chip_usb_dw_wrapper.h"
234+
#endif
235+
225236
NORETURN static void machine_bootloader_rtc(void) {
237+
#if CONFIG_IDF_TARGET_ESP32S3
238+
usb_usj_mode();
239+
#endif
240+
usb_dc_prepare_persist();
241+
chip_usb_set_persist_flags(USBDC_BOOT_DFU);
226242
REG_WRITE(RTC_CNTL_OPTION1_REG, RTC_CNTL_FORCE_DOWNLOAD_BOOT);
243+
mp_hal_delay_ms(100);
227244
esp_restart();
228245
}
229246
#endif

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy