From f0380459b447bf3b65d31cd91ec4922611fa4ffb Mon Sep 17 00:00:00 2001 From: deadprogram Date: Sat, 26 Sep 2026 15:27:10 +0200 Subject: [PATCH] machine/esp32c6: add default UART0 pins UART.Configure had no default pins, so Configure(UARTConfig{}) returned errSamePins and -serial=uart gave no output. Use GPIO16 and GPIO17, the defaults from ESP-IDF soc/esp32c6/include/soc/uart_pins.h. --- src/machine/machine_esp32c6.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/machine/machine_esp32c6.go b/src/machine/machine_esp32c6.go index e6b7988dd7..6fd1bc0585 100644 --- a/src/machine/machine_esp32c6.go +++ b/src/machine/machine_esp32c6.go @@ -328,6 +328,11 @@ func (uart *UART) Configure(config UARTConfig) error { if config.BaudRate == 0 { config.BaudRate = 115200 } + if uart.Bus == esp.UART0 && config.TX == 0 && config.RX == 0 { + // Default UART0 pins. See ESP-IDF soc/esp32c6/include/soc/uart_pins.h. + config.TX = GPIO16 + config.RX = GPIO17 + } if config.TX == config.RX { return errSamePins }