From d47004ef56bb31a096a15fb696b5058f30aac893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radim=20Karni=C5=A1?= Date: Tue, 3 Dec 2024 15:13:45 +0100 Subject: [PATCH] fix(esp32-c6): Disable RTC WDT reset to prevent port disappearing --- esptool/targets/esp32c6.py | 6 ++++++ esptool/targets/esp32h2.py | 1 + 2 files changed, 7 insertions(+) diff --git a/esptool/targets/esp32c6.py b/esptool/targets/esp32c6.py index b4cb5d829..16b5531d1 100644 --- a/esptool/targets/esp32c6.py +++ b/esptool/targets/esp32c6.py @@ -6,6 +6,7 @@ import struct from .esp32c3 import ESP32C3ROM +from ..loader import ESPLoader from ..util import FatalError, NotImplementedInROMError @@ -194,6 +195,11 @@ def check_spi_connection(self, spi_connection): "consider using other pins for SPI flash connection." ) + def hard_reset(self): + # Bug in the USB-Serial/JTAG controller can cause the port to disappear + # if the chip is reset with RTC WDT, do a classic reset + ESPLoader.hard_reset(self) + class ESP32C6StubLoader(ESP32C6ROM): """Access class for ESP32C6 stub loader, runs on top of ROM. diff --git a/esptool/targets/esp32h2.py b/esptool/targets/esp32h2.py index 59604f2d6..65ea03751 100644 --- a/esptool/targets/esp32h2.py +++ b/esptool/targets/esp32h2.py @@ -80,6 +80,7 @@ def get_crystal_freq(self): return 32 def hard_reset(self): + # RTC WDT reset not available, do a classic reset ESPLoader.hard_reset(self) def check_spi_connection(self, spi_connection):