Skip to content

Commit 667861b

Browse files
committed
fix(change_baud): Disable changing baud rate on ESP32-C2 and ESP32-C5 in SDM
1 parent 6aad895 commit 667861b

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
@@ -106,6 +106,12 @@ def get_crystal_freq(self):
106106
return ESPLoader.get_crystal_freq(self)
107107

108108
def change_baud(self, baud):
109+
if self.secure_download_mode: # ESPTOOL-1231
110+
print(
111+
"WARNING: Baud rate change is not supported in secure download mode. "
112+
"Keeping 115200 baud."
113+
)
114+
return
109115
rom_with_26M_XTAL = not self.IS_STUB and self.get_crystal_freq() == 26
110116
if rom_with_26M_XTAL:
111117
# 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
@@ -132,7 +132,12 @@ def hard_reset(self):
132132
ESPLoader.hard_reset(self, self.uses_usb_jtag_serial())
133133

134134
def change_baud(self, baud):
135-
if not self.IS_STUB:
135+
if self.secure_download_mode: # ESPTOOL-1231
136+
print(
137+
"WARNING: Baud rate change is not supported in secure download mode. "
138+
"Keeping 115200 baud."
139+
)
140+
elif not self.IS_STUB:
136141
crystal_freq_rom_expect = self.get_crystal_freq_rom_expect()
137142
crystal_freq_detect = self.get_crystal_freq()
138143
print(

0 commit comments

Comments
 (0)