docs: format establish-serial-connection.rst

This commit is contained in:
Linda 2024-08-06 15:26:24 +08:00 committed by BOT
parent a263f833c9
commit 14cdd8ba2b
2 changed files with 30 additions and 32 deletions

View File

@ -300,26 +300,12 @@ Run terminal and set identified serial port. Baud rate = 115200 (if needed, chan
Setting Serial Communication in PuTTY on Linux Setting Serial Communication in PuTTY on Linux
Then open serial port in terminal and check, if you see any log printed out by {IDF_TARGET_NAME}. The log contents depend on application loaded to {IDF_TARGET_NAME}, see `Example Output`_. Reset the board if no log has been printed out. Then open serial port in terminal and check, if you see any log printed out by {IDF_TARGET_NAME}. The log contents depend on application loaded to {IDF_TARGET_NAME}, see `Example Output`_. If no log has been printed out, see `Troubleshooting`_.
.. note:: .. note::
Close the serial terminal after verification that communication is working. If you keep the terminal session open, the serial port will be inaccessible for uploading firmware later. Close the serial terminal after verification that communication is working. If you keep the terminal session open, the serial port will be inaccessible for uploading firmware later.
.. note::
If there is no log output, check
- if the required power is supplied to {IDF_TARGET_NAME}
- if the board was reset after starting the terminal program
- if the selected serial port is the correct one by using the method stated in `Check Port on Windows`_ and `Check Port on Linux and macOS`_
- if the serial port is not being used by another program
- if the identified port has been selected in serial terminal programs you are using, as stated in `Windows and Linux`_
- if settings of the serial port in serial terminal programs are applicable to corresponding applications
- if the correct USB connector (UART) is used on the development board
- if your application is expected to output some log
- if the log output has not been disabled (use :example:`hello world application <get-started/hello_world>` to test)
macOS macOS
^^^^^ ^^^^^
@ -339,12 +325,25 @@ To spare you the trouble of installing a serial terminal program, macOS offers t
Replace ``device_name`` with the name found running ``ls /dev/cu.*``. Replace ``device_name`` with the name found running ``ls /dev/cu.*``.
- What you are looking for is some log displayed by the **screen**. The log contents depend on application loaded to {IDF_TARGET_NAME}, see `Example Output`_. To exit the current **screen** session, type ``Ctrl-A + K``. - What you are looking for is some log displayed by the **screen**. The log contents depend on application loaded to {IDF_TARGET_NAME}, see `Example Output`_. If no log has been printed out, see `Troubleshooting`_. To exit the current **screen** session, type ``Ctrl-A + K``.
.. note:: .. note::
Do not forget to **exit the current screen session** after verifying that the communication is working. If you fail to do it and just close the terminal window, the serial port will be inaccessible for uploading firmware later. Do not forget to **exit the current screen session** after verifying that the communication is working. If you fail to do it and just close the terminal window, the serial port will be inaccessible for uploading firmware later.
Troubleshooting
^^^^^^^^^^^^^^^
If there is no log output, check
- if the required power is supplied to {IDF_TARGET_NAME}
- if the board was reset after starting the terminal program
- if the selected serial port is the correct one by using the method stated in `Check Port on Windows`_ and `Check Port on Linux and macOS`_
- if the serial port is not being used by another program
- if settings of the serial port in serial terminal programs are applicable to corresponding applications
- if your application is expected to output some log. In details, if ``Component config`` > ``Log`` > ``Log Level`` > ``Default log verbosity (Info)`` is set to ``No output``, no log will be printed out. You can change this setting in ``menuconfig``.
- if the log output has not been disabled (use :example:`hello world application <get-started/hello_world>` to test)
Example Output Example Output
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^

View File

@ -300,26 +300,12 @@ Windows 和 Linux 操作系统
在 Linux 操作系统中使用 PuTTY 设置串口通信参数 在 Linux 操作系统中使用 PuTTY 设置串口通信参数
然后,请检查 {IDF_TARGET_NAME} 是否有打印日志。如有,请在终端打开串口进行查看。这里的日志内容取决于加载到 {IDF_TARGET_NAME} 的应用程序,请参考 `输出示例`_。如果没有看到输出日志,请尝试重启开发板 然后,请检查 {IDF_TARGET_NAME} 是否有打印日志。如有,请在终端打开串口进行查看。这里的日志内容取决于加载到 {IDF_TARGET_NAME} 的应用程序,请参考 `输出示例`_。如果没有看到输出日志,请参考 `故障排除`_
.. 注解:: .. 注解::
请在验证完串口通信正常后,关闭串口终端。如果终端一直保持打开的状态,之后上传固件时将无法访问串口。 请在验证完串口通信正常后,关闭串口终端。如果终端一直保持打开的状态,之后上传固件时将无法访问串口。
.. 注解::
如果没有日志输出,请检查以下原因:
- {IDF_TARGET_NAME} 的供电是否正常
- 启动终端程序后,是否重置开发板
- 使用 `在 Windows 上查看端口`_`在 Linux 和 macOS 上查看端口`_ 中描述的方法,检查所选串口是否正确
- 其他程序是否正在使用该串口
- 对于 `Windows 和 Linux 操作系统`_ 中描述的串口终端程序,其选择的端口是否正确
- 串口终端程序中的串口设置是否适用于该应用程序
- 开发板上选择的 USB 连接器UART是否正确
- 应用程序是否会输出日志
- 是否禁用了日志输出(使用 :example:`hello world 示例 <get-started/hello_world>` 进行测试)
macOS 操作系统 macOS 操作系统
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
@ -339,12 +325,25 @@ macOS 提供了 **屏幕** 命令,因此无需安装串口终端程序。
``device_name`` 替换为运行 ``ls /dev/cu.*`` 后出现的设备串口号。 ``device_name`` 替换为运行 ``ls /dev/cu.*`` 后出现的设备串口号。
- **屏幕** 显示的日志即为所需内容。日志内容取决于加载到 {IDF_TARGET_NAME} 的应用程序,请参考 `输出示例`_。请使用 ``Ctrl-A + K`` 键退出当前 **屏幕** 会话。 - **屏幕** 显示的日志即为所需内容。日志内容取决于加载到 {IDF_TARGET_NAME} 的应用程序,请参考 `输出示例`_如果没有看到输出日志,请参考 `故障排除`_请使用 ``Ctrl-A + K`` 键退出当前 **屏幕** 会话。
.. 注解:: .. 注解::
请在验证完串口通信正常后,关闭 **当前屏幕会话**。如果直接关闭终端窗口而没有关闭 **屏幕**,之后上传固件时将无法访问串口。 请在验证完串口通信正常后,关闭 **当前屏幕会话**。如果直接关闭终端窗口而没有关闭 **屏幕**,之后上传固件时将无法访问串口。
故障排除
^^^^^^^^^^^^^^^
如果没有日志输出,请检查以下原因:
- {IDF_TARGET_NAME} 的供电是否正常
- 启动终端程序后,是否重置开发板
- 使用 `在 Windows 上查看端口`_`在 Linux 和 macOS 上查看端口`_ 中描述的方法,检查所选串口是否正确
- 其他程序是否正在使用该串口
- 串口终端程序中的串口设置是否适用于该应用程序
- 应用程序是否会输出日志。具体来说,如果在 ``Component config`` > ``Log`` > ``Log Level`` > ``Default log verbosity (Info)`` 中设置为 ``No output``,则不会打印出任何日志。你可以在 ``menuconfig`` 中更改该设置。
- 是否禁用了日志输出(使用 :example:`hello world 示例 <get-started/hello_world>` 进行测试)
输出示例 输出示例
^^^^^^^^^^^ ^^^^^^^^^^^