Skip to content

Commit ecddca6

Browse files
committed
docs: add command example to get-started/establish-serial-connection
1 parent 4cb3a75 commit ecddca6

File tree

3 files changed

+51
-3
lines changed

3 files changed

+51
-3
lines changed

docs/en/get-started/establish-serial-connection.rst

+25-1
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,34 @@ For devices downloaded using a USB-to-UART bridge, you can run the following com
183183
184184
idf.py -p PORT [-b BAUD] flash
185185
186-
You can change the flasher baud rate by replacing ``BAUD`` with the baud rate you need. The default baud rate is ``460800``.
186+
Replace ``PORT`` with the device name for the serial port of your {IDF_TARGET_NAME} board. Please note that ``-b`` is an optional argument. If you do not specify the baud rate, the default baud rate is ``460800``. If you need to specify the baud rate, replace ``BAUD`` with the baud rate you need.
187+
188+
To check the port name on Windows, please refer to `check-port-on-windows`_. For Linux and macOS users, please see `check-port-on-linux-and-macos`_.
189+
190+
For example, if the port name is ``COM3`` on Windows and your desired baud rate is ``115200``, you can run the following command to flash the device:
191+
192+
.. code-block:: bash
193+
194+
idf.py -p COM3 -b 115200 flash
195+
196+
For Linux users, if the port name is ``/dev/ttyUSB0`` and the desired baud rate is ``115200``, you can run the following command to flash the device:
197+
198+
.. code-block:: bash
199+
200+
idf.py -p /dev/ttyUSB0 -b 115200 flash
201+
202+
For macOS users, if the port name is ``/dev/cu.usbserial-1401`` and the desired baud rate is ``115200``, you can run the following command to flash the device:
203+
204+
.. code-block:: bash
205+
206+
idf.py -p /dev/cu.usbserial-1401 -b 115200 flash
187207
188208
.. note::
189209

190210
If the device does not support the auto download mode, you need to get into the download mode manually. To do so, press and hold the ``BOOT`` button and then press the ``RESET`` button once. After that release the ``BOOT`` button.
191211

212+
.. _check-port-on-windows:
213+
192214
Check Port on Windows
193215
---------------------
194216

@@ -210,6 +232,8 @@ Figures below show serial port for ESP32 DevKitC and ESP32 WROVER KIT
210232

211233
Two USB Serial Ports of ESP-WROVER-KIT in Windows Device Manager
212234

235+
.. _check-port-on-linux-and-macos:
236+
213237
Check Port on Linux and macOS
214238
-----------------------------
215239

docs/zh_CN/get-started/establish-serial-connection.rst

+25-1
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,34 @@
183183
184184
idf.py -p PORT [-b BAUD] flash
185185
186-
如需改变烧录器的波特率,请用需要的波特率代替 ``BAUD``。默认的波特率为 ``460800``。
186+
将 ``PORT`` 替换为 {IDF_TARGET_NAME} 开发板的串口名称。``-b`` 为可选参数,默认的波特率为 ``460800``。如需改变烧录器的波特率,请用需要的波特率代替 ``BAUD``。
187+
188+
要查看串口名称,Windows 用户请参考 `check-port-on-windows`_,Linux 与 macOS 用户请参考 `check-port-on-linux-and-macos`_。
189+
190+
例如,Windows 平台上串口名称为 ``COM3``,所需波特率为 ``115200``,可使用如下命令烧录开发板:
191+
192+
.. code-block:: bash
193+
194+
idf.py -p COM3 -b 115200 flash
195+
196+
Linux 平台上串口名称为 ``/dev/ttyUSB0``,所需波特率为 ``115200``,可使用如下命令烧录开发板:
197+
198+
.. code-block:: bash
199+
200+
idf.py -p /dev/ttyUSB0 -b 115200 flash
201+
202+
macOS 平台上串口名称为 ``/dev/cu.usbserial-1401``,所需波特率为 ``115200``,可使用如下命令烧录开发板:
203+
204+
.. code-block:: bash
205+
206+
idf.py -p /dev/cu.usbserial-1401 -b 115200 flash
187207
188208
.. note::
189209

190210
如果设备不支持自动下载模式,则需要手动进入下载模式。请按住 ``BOOT`` 按钮,同时按一下 ``RESET`` 按钮。之后,松开 ``BOOT`` 按钮。
191211

212+
.. _check-port-on-windows:
213+
192214
在 Windows 上查看端口
193215
---------------------
194216

@@ -210,6 +232,8 @@
210232

211233
Windows 设备管理器中 ESP-WROVER-KIT 的两个 USB 串行端口
212234

235+
.. _check-port-on-linux-and-macos:
236+
213237
在 Linux 和 macOS 上查看端口
214238
-----------------------------
215239

docs/zh_CN/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ESP-IDF 编程指南
99

1010
快速预览中不包括 API 函数文档。如需生成完整的文档,请在 MR 中添加 docs_full 标签。
1111

12-
这里是乐鑫 IoT 开发框架 (`esp-idf <https://github.com/espressif/esp-idf>`_) 的文档中心。ESP-IDF 是 `ESP32、ESP32-S ESP32-C、ESP32-H 和 ESP32-P <https://www.espressif.com/en/products/socs>`_ 系列芯片的官方开发框架。
12+
这里是乐鑫 IoT 开发框架 (`esp-idf <https://github.com/espressif/esp-idf>`_) 的文档中心。ESP-IDF 是 `ESP32、ESP32-SESP32-C、ESP32-H 和 ESP32-P <https://www.espressif.com/en/products/socs>`_ 系列芯片的官方开发框架。
1313

1414
.. only:: html
1515

0 commit comments

Comments
 (0)