AP_HAL_ESP32: allow UART0 to use USB Serial/JTAG - #34066
Open
muramura wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Built Copter for
esp32s3m5stampfly.Flashed to M5StampFly and confirmed bidirectional MAVLink communication over
/dev/ttyACM0using ESP32-S3 USB Serial/JTAG:Confirmed MAVLink heartbeat, parameter download, and command input.
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_JTAGhwdef 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_PROTOCOLas the normal MAVLink protocol selection.SERIAL0_BAUDremains a compatibility setting; the physical transport is USB, not a GPIO UART baudrate.