Skip to content

AP_HAL_ESP32: allow UART0 to use USB Serial/JTAG - #34066

Open
muramura wants to merge 1 commit into
ArduPilot:masterfrom
muramura:esp32-usb-serial-jtag-uart0
Open

AP_HAL_ESP32: allow UART0 to use USB Serial/JTAG#34066
muramura wants to merge 1 commit into
ArduPilot:masterfrom
muramura:esp32-usb-serial-jtag-uart0

Conversation

@muramura

Copy link
Copy Markdown
Contributor

Summary

Allow ESP32 boards to opt in to using ESP32-S3 USB Serial/JTAG for UART0.

This enables M5StampFly to use USB Serial/JTAG as the console/MAVLink port instead of the unused UART0 GPIO pins.

Classification & Testing

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request

Built Copter for esp32s3m5stampfly.

Flashed to M5StampFly and confirmed bidirectional MAVLink communication over /dev/ttyACM0 using ESP32-S3 USB Serial/JTAG:

mavproxy.py --master=/dev/ttyACM0 --baudrate 921600

Confirmed MAVLink heartbeat, parameter download, and command input.

スクリーンショット 2026-08-15 16 37 03

Description

M5StampFly is an ESP32-S3 based vehicle. Its UART0 GPIO pins are not useful as an external telemetry connection, but ESP32-S3 provides USB Serial/JTAG over the USB connector.

This PR adds an opt-in HAL_ESP32_UART0_USB_SERIAL_JTAG hwdef define. Existing ESP32 board behavior is unchanged unless a board explicitly enables this define.

When enabled for UART0, the ESP32 UART driver uses the ESP-IDF USB Serial/JTAG driver for reads and writes. This allows the console/MAVLink port to work over USB while keeping SERIAL0_PROTOCOL as the normal MAVLink protocol selection. SERIAL0_BAUD remains a compatibility setting; the physical transport is USB, not a GPIO UART baudrate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant