fix: pass error message to exception in OTG mode

Closes https://github.com/espressif/esptool/issues/996
Closes https://github.com/espressif/esptool/issues/997
This commit is contained in:
Peter Dragun
2024-08-05 14:01:11 +02:00
committed by Radim Karniš
parent 7cc35e4e4d
commit c266fdda71
2 changed files with 10 additions and 16 deletions

View File

@@ -296,15 +296,12 @@ class ESP32S2ROM(ESP32ROM):
strap_reg & self.GPIO_STRAP_SPI_BOOT_MASK == 0
and force_dl_reg & self.RTC_CNTL_FORCE_DOWNLOAD_BOOT_MASK == 0
):
print(
"WARNING: {} chip was placed into download mode using GPIO0.\n"
"esptool.py can not exit the download mode over USB. "
"To run the app, reset the chip manually.\n"
"To suppress this note, set --after option to 'no_reset'.".format(
self.get_chip_description()
)
raise SystemExit(
f"Error: {self.get_chip_description()} chip was placed into download "
"mode using GPIO0.\nesptool.py can not exit the download mode over "
"USB. To run the app, reset the chip manually.\n"
"To suppress this note, set --after option to 'no_reset'."
)
raise SystemExit(1)
def hard_reset(self):
uses_usb_otg = self.uses_usb_otg()

View File

@@ -358,15 +358,12 @@ class ESP32S3ROM(ESP32ROM):
strap_reg & self.GPIO_STRAP_SPI_BOOT_MASK == 0
and force_dl_reg & self.RTC_CNTL_FORCE_DOWNLOAD_BOOT_MASK == 0
):
print(
"WARNING: {} chip was placed into download mode using GPIO0.\n"
"esptool.py can not exit the download mode over USB. "
"To run the app, reset the chip manually.\n"
"To suppress this note, set --after option to 'no_reset'.".format(
self.get_chip_description()
)
raise SystemExit(
f"Error: {self.get_chip_description()} chip was placed into download "
"mode using GPIO0.\nesptool.py can not exit the download mode over "
"USB. To run the app, reset the chip manually.\n"
"To suppress this note, set --after option to 'no_reset'."
)
raise SystemExit(1)
def hard_reset(self):
uses_usb_otg = self.uses_usb_otg()