fix(esp32c2): Recommend using higher baud rate if connection fails

This commit is contained in:
Jakub Kocka
2023-11-09 14:22:12 +01:00
parent 4622bb24e6
commit ef0c91f8c7
2 changed files with 15 additions and 0 deletions

View File

@@ -40,6 +40,12 @@ When communicating with the {IDF_TARGET_NAME} ROM serial bootloader, the followi
| Flow control | None |
+---------------------+-------------------+
.. only:: esp32c2
.. note::
You might experience issues when using low baud rates on {IDF_TARGET_NAME}. If you encounter any problems when connecting, please use at least 115200 or higher.
.. only:: esp8266
.. note::

View File

@@ -682,8 +682,17 @@ class ESPLoader(object):
print("") # end 'Connecting...' line
if last_error is not None:
additional_msg = ""
if self.CHIP_NAME == "ESP32-C2" and self._port.baudrate < 115200:
additional_msg = (
"\nNote: Please set a higher baud rate (--baud)"
" if ESP32-C2 doesn't connect"
" (at least 115200 Bd is recommended)."
)
raise FatalError(
"Failed to connect to {}: {}"
f"{additional_msg}"
"\nFor troubleshooting steps visit: "
"https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html".format( # noqa E501
self.CHIP_NAME, last_error