ESP32 TX and RX pins

Hi. I would like to use the Adafruit ESP32 V2 feather to gather data for home assistant via the TX and RX pin. The pin numbers are 7 and 8 (see Adafruit Learning System). However, the compilation of the firmware fails with the error “This pin cannot be used on ESP32s and is already used by the flash interface (function: Flash Data 1)”. There are no other TX and RX pins on this board. How can I use the TX and RX pin on this board?

The configuration:

esp32:
board: adafruit_feather_esp32_v2
framework:
type: arduino

uart:

  • id: uart_modbus
    baud_rate: 9600
    tx_pin: 8 # GPIO8 gives same result
    rx_pin: 7 # GPIO7 gives same result

GPIO6 to GPIO11 are used for the ESP32 flash memory. ESP32 can assign the UART RX/TX to most GPIO pins. I’d recommend just using any convenient pair between GPIO16 and GPIO33.

@mulcmu The pinout diagram of the board dazzles a little bit. Is it important to use pins with a uart indication (like 19 and 22) or can it be something random (like 27 and 33)?

Adafruit seem to be telling us their boards are wired differently.

Can I just use different pins and name them RX and TX in the configuration despite they have a different label on the board itself?

Most of the pins have multiple use possibilities. Look at the pinout of your board… it will tell you which pins can do what and they’re usually color coded too.