From 68085fb46fb45f689c3df42af32195a837647fb4 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 13 Nov 2023 21:22:37 +0700 Subject: [PATCH] fix issue when s3 switch usb from cdc to jtag while reset to bootrom --- cores/esp32/esp32-hal-tinyusb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cores/esp32/esp32-hal-tinyusb.c b/cores/esp32/esp32-hal-tinyusb.c index fa97fb8bb41..bd909af4ec1 100644 --- a/cores/esp32/esp32-hal-tinyusb.c +++ b/cores/esp32/esp32-hal-tinyusb.c @@ -61,7 +61,12 @@ typedef struct { static bool usb_otg_deinit(void * busptr) { // Once USB OTG is initialized, its GPIOs are assigned and it shall never be deinited + // except when S3 swithicng usb from cdc to jtag while resetting to bootrom +#if CONFIG_IDF_TARGET_ESP32S3 + return true; +#else return false; +#endif } static void configure_pins(usb_hal_context_t *usb)