Home / Peripherals / UART
ESP32 UART Guide: UART0/1/2 Default Pins and Download Conflicts
Which pins each of the three UARTs defaults to, why UART1 appears broken, and what to check when flashing fails.
The three UARTs
| UART | Default TX | Default RX | Typical use |
|---|---|---|---|
| UART0 | GPIO1 | GPIO3 | Flashing and default log output — leave it alone |
| UART1 | GPIO10 | GPIO9 | Defaults collide with flash; must be remapped |
| UART2 | GPIO17 | GPIO16 | GPS modules, serial displays, RS485 |
Why UART1 seems broken
UART1's default pins are GPIO9 and GPIO10 — the very pins most ESP32 modules use for internal SPI flash. Initialise UART1 as-is and flash access breaks, taking the chip down with it.
Fix: call
uart_set_pin() and move UART1 to any free pair, e.g. TX=GPIO18, RX=GPIO19. It is the only reliable option.Check these pins when flashing fails
- GPIO0: hold low and reset to enter download mode. This is the BOOT button on dev boards.
- GPIO1 / GPIO3: keep peripherals that drive these lines at power-up away (some GPS modules start talking immediately and drown the boot log).
- GPIO2 / GPIO12 / GPIO15: strapping pins — external pull resistors scramble the boot mode.
Practical notes
- 115200 is the usual baud rate. Higher rates suffer from divider inaccuracy; on long or noisy runs 9600 / 19200 is far more robust.
- RS485 needs a GPIO for direction, with a short settle delay either side of the transmission.
- Every UART can be remapped through the GPIO matrix — you are not stuck with the defaults.
- For real throughput, use UART2 with DMA rather than pushing the baud rate.
This page defaults to the original ESP32. Other chips differ in UART count and defaults (the C3 has only two UARTs) — check the documentation for your target.
Data verified:2026-10-20 · Cross-checked against Espressif documentation. Anything that varies between chips or ESP-IDF releases is marked rather than guessed.
Official peripheral docs →
Related
I²CWhich two pins to use for I²C on the ESP32, what pull-up value to pick, and why your device never shows up on the bus scan.SPIWhich pins HSPI and VSPI default to, how fast you can realistically clock them, and why your display stays black.RMT (IR & WS2812)RMT is the most underrated ESP32 peripheral: IR remotes, WS2812 strips and one-wire sensors all depend on it. Channels, resolution and the Wi-Fi interference problem.LEDC PWMThe ESP32 LEDC offers 16 PWM channels. Frequency and resolution trade off against each other — here is the maths and recommended values.Deep SleepHow low the current really goes, which pins can wake the chip, and whether your variables survive. Use it with the battery life calculator.