Xiao-esp32c6 uarts

I’m trying to better understand the UARTS available on the XIAO-ESP32C6 module. I looked at the Technical Reference Manual for the ESP32C6 chip and see that it has three UARTS. Two of the UARTS (named uart0 and uart1) are referred to as normal UARTS. The third one is referred to as the low power UART. My questions follow:

  1. Is one of the normal UARTS associated with the USB serial port? If so, which one?
  2. Is one of the normal UARTS associated with the XIAO-ESP32C6 TX/D6 and RX/D7 pins?
  3. Is the low power UART accessible on the XIAO-ESP32C6 module?

Thanks!

Jim

Hi there,

So Great Question, very specific :+1: backed with some understanding. Here is what I know and have experience in testing.
some may have other…
The ESP32-C6 has 3 UARTs:

  1. UART0 (Hardware Serial 0)
  • Mapped to USB Serial (Serial)
  • Used for programming and Serial.print() via USB
  • Internally wired through the USB-to-Serial bridge (CH9102) on the Xiao board
  • Do not use for general GPIO TX/RX — it’s virtual over USB
  1. UART1 (Hardware Serial 1)
  • Exposed on GPIO6 (D6 = TX) and GPIO7 (D7 = RX)
  • Use this for hardware serial comms with other devices
  • Mapped as Serial1.begin(baud, SERIAL_8N1, RX, TX); — already defaults to GPIO7/6
  1. LP-UART (Low-Power UART / UART2)
  • Exists on the chip (for deep sleep wake and light tasks)
  • Not exposed by the Arduino BSP by default
  • Might be used internally (like JTAG or boot/debug), but not available out-of-the-box on the Xiao board
  • You’d need ESP-IDF and GPIO re-mapping to access it — not typically accessible via Arduino or in common use

You will find many examples on here of Hardware and software Serial applications “Xiao 2 Serial ports” the general rule of thumb is Use Hardware serial whenever possible, and with Software serial you need to explicitly define or name your pins. NOTE: SOme BSP support the pin macros and some do NOT so use GPIO numbers in place of Logical ones. :+1:
it’s not rocket science but requires some attention to detail to implement well

Answers to Jim’s Questions:

Is one of the normal UARTs associated with the USB serial port?

Yes. UART0 is used for USB serial (uploading and Serial.print()).

Is one of the normal UARTs associated with the XIAO-ESP32C6 TX/D6 and RX/D7 pins?

Yes. UART1 is exposed via D6 (TX) and D7 (RX).

Is the low power UART accessible on the XIAO-ESP32C6 module?

Not directly via Arduino. You’d need ESP-IDF and to re-map it manually. It’s not exposed on any Xiao pin by default and is not used in Arduino sketches unless you go low-level.

HTH
GL :slight_smile: PJ :v:

2 Likes

Thank you, once again, PJ!

1 Like

Yes, it is - I use it for handling low power wake up by an external device for sending data to my Zigbee network by the 'C6.

Not true (except for 1).

Not true either.


#ifdef USE_UART2  // Any GPIO MUX
#define RX_PIN 4 // Default LP_RX0,  GPIO_NUM_4
#define TX_PIN 5 // Default LP_TX0,  GPIO_NUM_5

HardwareSerial MySerial2(2);
#endif  // USE_UART2