Skip to content

Commit 9286189

Browse files
committed
fix(change_baud): Disable changing baud rate on ESP32-C2 and ESP32-C5 in SDM
1 parent 0bc3879 commit 9286189

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

esptool/targets/esp32c2.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ def get_crystal_freq(self):
109109
return ESPLoader.get_crystal_freq(self)
110110

111111
def change_baud(self, baud):
112+
if self.secure_download_mode: # ESPTOOL-1231
113+
log.warning(
114+
"Baud rate change is not supported in secure download mode. "
115+
"Keeping 115200 baud."
116+
)
117+
return
112118
rom_with_26M_XTAL = not self.IS_STUB and self.get_crystal_freq() == 26
113119
if rom_with_26M_XTAL:
114120
# The code is copied over from ESPLoader.change_baud().

esptool/targets/esp32c5.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,12 @@ def hard_reset(self):
145145
ESPLoader.hard_reset(self, self.uses_usb_jtag_serial())
146146

147147
def change_baud(self, baud):
148-
if not self.IS_STUB:
148+
if self.secure_download_mode: # ESPTOOL-1231
149+
log.warning(
150+
"Baud rate change is not supported in secure download mode. "
151+
"Keeping 115200 baud."
152+
)
153+
elif not self.IS_STUB:
149154
crystal_freq_rom_expect = self.get_crystal_freq_rom_expect()
150155
crystal_freq_detect = self.get_crystal_freq()
151156
log.print(

0 commit comments

Comments
 (0)