Skip to content

Latest commit

 

History

History
60 lines (39 loc) · 3.07 KB

How_to_set_AT_port_pin.rst

File metadata and controls

60 lines (39 loc) · 3.07 KB

How to Set AT Port Pins

{IDF_TARGET_HYPHEN_LOWERCASE_NAME: default="undefined", esp32="esp32", esp32c3="esp32-c3"}

:link_to_translation:`zh_CN:[中文]`

This document introduces how to modify :term:`AT port` pins in the firmware for {IDF_TARGET_NAME} series of products. By default, ESP-AT uses two UART interfaces as AT ports: one is to output logs (named as log port below) and the other to send AT commands and receive responses (named as command port below).

To modify the AT port pins of your {IDF_TARGET_NAME}, you should:

This document focuses on modifying the pins. Click the links above for details of other steps.

{IDF_TARGET_NAME} Series

The log port and command port pins of {IDF_TARGET_NAME} AT firmware can be user-defined to other pins. Refer to {IDF_TARGET_NAME} Technical Reference Manual for the pins you can use.

Modify Log Port Pins

By default, the {IDF_TARGET_NAME} AT firmware provided by Espressif uses the following UART0 pins to output log:

.. only:: esp32

  - TX: GPIO1
  - RX: GPIO3

.. only:: esp32c3 or esp32c2

  - TX: GPIO21
  - RX: GPIO20

When compiling your ESP-AT project, you can modify them to other pins with the menuconfig utitlity:

  • ./build.py menuconfig --> Component config --> Common ESP-related --> UART for console output
  • ./build.py menuconfig --> Component config --> Common ESP-related --> UART TX on GPIO#
  • ./build.py menuconfig --> Component config --> Common ESP-related --> UART RX on GPIO#

Modify Command Port Pins

By default, UART1 is used to send AT commands and receive AT responses, and its pins are defined in Column uart_port, uart_tx_pin, uart_rx_pin, uart_cts_pin, and uart_rts_pin of the :component_file:`factory_param_data.csv <customized_partitions/raw_data/factory_param/factory_param_data.csv>`.

You can change them directly in your factory_param_data.csv table:

  • Open your local factory_param_data.csv file.
  • Locate the row of your module.
  • Set uart_port as needed.
  • Set uart_tx_pin and uart_rx_pin as needed.
  • Set uart_cts_pin and uart_rts_pin to be -1 if you do not use the hardware flow control function.
  • Save the table.