ESP32 Pinout Engineering Guide: Boot Strapping, USB, Flash/PSRAM Conflicts & EPAD
Derived directly from the 24 verified chip pinout definitions in src/data/pinouts.ts (QFN24 through QFN104 and LGA40 through LGA56, plus 3 pending series: ESP32-E22, ESP32-H21, ESP32-H4).
Live Verified Specification Matrix
| Series | Status | Core(s) / max clock | SRAM / PSRAM | Wireless | USB / EMAC | Maximum GPIO | SKUs / Mod / Kit |
|---|---|---|---|---|---|---|---|
| ESP32-C6 | Mass production | 1× RISC-V @ 160 MHz | 512 KB HP + 16 KB LP / None | 2.4 GHz Wi-Fi 6 · Bluetooth 5 LE · 802.15.4 | USB Serial/JTAG / No | 30 | 3 / 4 / 2 |
| ESP32-S3 | Mass production | 2× Xtensa LX7 @ 240 MHz | 512 KB / External or 2/8/16 MB in-package (OPI/QPI) | 2.4 GHz Wi-Fi 4 · Bluetooth 5 LE | USB FS OTG + JTAG / No | 45 | 10 / 5 / 14 |
| ESP32-C3 | Mass production | 1× RISC-V @ 160 MHz | 400 KB / None | 2.4 GHz Wi-Fi 4 · Bluetooth 5 LE | USB Serial/JTAG / No | 22 | 8 / 10 / 8 |
| ESP32-P4 | Mass production | 2× RISC-V @ 400 MHz | 768 KB HP + 32 KB LP / 16 / 32 MB in-package (OPI/HPI, 250 MHz v3.x) | None | USB HS OTG + JTAG / EMAC | 55 | 4 / 0 / 5 |
| ESP32-S31 | Mass production | 2× RISC-V @ 320 MHz | 512 KB HP + 32 KB LP / 8 / 16 / 32 MB in-package (1.8 V 250 MHz DDR) | 2.4 GHz Wi-Fi 6 · Bluetooth 5.4 LE + Bluetooth Classic · 802.15.4 | USB HS OTG + JTAG / EMAC | 60 | 3 / 4 / 3 |
1. Package Pinout Coverage & Revision-Split Maps (24 Verified, 3 Pending)
A single ESP32 series often ships in multiple physical pinouts depending on package size and whether flash or PSRAM dies are bonded inside the package. For example, QFN40 (5×5 mm), top view exposes 40 perimeter pads with external SPI flash signals (#20–#26), whereas QFN32 (5×5 mm, in-package flash), top view removes those flash pins entirely in a 32-pin footprint.
Three newer pre-production series—ESP32-E22 (QFN 9×9 mm, 41 GPIOs), ESP32-H21 (QFN 4×4 mm, 19 usable / 26 physical GPIOs), and ESP32-H4 (QFN 6×6 mm, 40 GPIOs)—remain explicitly marked pending because Espressif has not published public datasheets with numbered QFN pin tables as of 2026-11-18.
2. Enable, Boot Strapping & JTAG-Warning Pins Across Packages
Every verified ESP32 pinout in src/data/pinouts.ts attaches hardware warnings to two universal control groups: the chip enable pin (CHIP_PU or CHIP_EN, which must never float and requires an RC delay / supervisor circuit) and the four JTAG / boot-related pads (MTMS, MTDI, MTCK, MTDO) whose reset state must be checked against the part-specific datasheet.
On classic ESP32, ESP32-S2, ESP32-S3, and ESP32-C3/ESP8685, external pull-ups or active sensors wired directly to boot strapping GPIOs can trap the chip in Download Boot mode or alter internal VDD_SPI flash voltage at power-on reset. Avoid driving heavy loads or uncontrolled push-pull outputs onto these pins during reset.
| Series / Package | Enable Pin | JTAG / Boot-Warning Pins | Verified Strapping / Reset Guidance |
|---|---|---|---|
| ESP32 (QFN48 / PICO LGA48) | CHIP_PU (#9) / EN | MTMS (#17), MTDI (#18), MTCK (#20), MTDO (#21) | GPIO0 (#23), GPIO2 (#22), GPIO5 (#32), MTDI/GPIO12, MTDO/GPIO15 — verify reset configuration per part |
| ESP32-S2 (QFN56) | CHIP_PU (#56) | MTCK (#43), MTDO (#44), MTDI (#46), MTMS (#47) | GPIO0 (#5), GPIO45 (#50), GPIO46 (#55) — check boot mode and VDD_SPI strapping in DS v1.9 |
| ESP32-S3 (QFN56 / PICO LGA56) | CHIP_PU (#4) | MTCK (#44), MTDO (#45), MTDI (#47), MTMS (#48) | GPIO0 (#5), GPIO3 (#8), GPIO45 (#51), GPIO46 (#52) — verify boot/JTAG/VDD_SPI straps in DS v2.2 |
| ESP32-S31 (QFN80) | CHIP_PU (#4) | MTDO (#69), MTCK (#70), MTDI (#71), MTMS (#72) | Verify preliminary DS v0.5 strapping table before locking carrier pull-ups |
| ESP32-P4 (QFN104) | CHIP_PU (#103) | See DS v0.7 reset configuration | Dedicated #27–#33 FLASH_* pins; note Pin 54 NC (v1.x EOL) vs VDD_HP_1 (v3.x MP) |
| ESP32-C2 / ESP8684 (QFN24) | CHIP_EN (#7) | MTMS (#9), MTDI (#10), MTCK (#12), MTDO (#13) | GPIO8 (#14), GPIO9 (#15) — confirm boot levels in ESP8684 DS v2.3 |
| ESP32-C3 (QFN32) / ESP8685 (QFN28) | CHIP_EN (#7) | MTMS (#9), MTDI (#10), MTCK (#12), MTDO (#13) | Verified in pinout-esp8685-qfn28: GPIO2 (#6), GPIO8 (#14), GPIO9 (#15, low = Download Boot) |
| ESP32-C5 (QFN48 / LGA48) | CHIP_PU (#7) | MTMS (#11), MTDI (#12), MTCK (#13), MTDO (#14) | Check ESP32-C5 DS v1.5 strapping table; note dual ANT_2G (#42) & ANT_5G (#48) ports |
| ESP32-C6 (QFN40 / QFN32) | CHIP_PU (#4) | MTMS (#10), MTDI (#11), MTCK (#12), MTDO (#13) | GPIO8 (#14) & GPIO9 (#15) present on both QFN40 & QFN32; verify reset strap table in DS v1.6 |
| ESP32-C61 (QFN40 / LGA40) | CHIP_PU (#4) | MTMS (#9), MTDI (#10), MTCK (#11), MTDO (#12) | GPIO8 (#31) & GPIO9 (#32) exposed; verify reset strap table in DS v1.1 |
| ESP32-H2 (QFN32) | CHIP_EN (#17) | MTMS (#5), MTDO (#6), MTCK (#7), MTDI (#8) | GPIO8 (#10) & GPIO9 (#11) exposed; verify reset strap table in DS v1.3 |
3. USB OTG vs USB Serial/JTAG Pin Mapping
Do not confuse USB OTG with USB Serial/JTAG. USB Serial/JTAG provides a built-in CDC-ACM virtual serial console plus JTAG debug endpoint over two pins—enough to flash and debug without an external CP2102/CH340 chip—but cannot enumerate as a USB Host, HID keyboard, MSC storage drive, or UVC camera.
Only five series carry true USB OTG: ESP32-S31 and ESP32-P4 include USB 2.0 High-Speed OTG (dedicated USB_DP/USB_DM pads), while ESP32-S2, ESP32-S3, and sampling ESP32-H4 support USB 2.0 Full-Speed OTG.
| Series | USB OTG | USB Serial/JTAG | Verified Package Pins (D- / D+) |
|---|---|---|---|
| ESP32 | None | No | No native USB PHY; use U0TXD (#38) / U0RXD (#37) + external USB-UART |
| ESP32-C2 / ESP8684 | None | No | No native USB PHY; use U0TXD (#20) / U0RXD (#19) + external USB-UART |
| ESP32-S2 | Full-speed | No | QFN56 #25 (GPIO19) / #26 (GPIO20) |
| ESP32-S3 | Full-speed | Yes | QFN56 & PICO LGA56 #25 (GPIO19) / #26 (GPIO20) |
| ESP32-S31 | High-speed | Yes | QFN80 #45 (USB_DM) / #44 (USB_DP) — dedicated HS USB pads |
| ESP32-P4 | High-speed (+ FS) | Yes | QFN104 #49 (USB_DM) / #50 (USB_DP) + #51 VDD_USBPHY |
| ESP32-C3 / ESP8685 | None | Yes | C3 QFN32 #25/#26 (GPIO18/19); ESP8685 QFN28 #21 (GPIO18 USB_D-) / #22 (GPIO19 USB_D+) |
| ESP32-C5 | None | Yes | QFN48 & LGA48 #22 (GPIO13 USB_D-) / #23 (GPIO14 USB_D+) |
| ESP32-C61 | None | Yes | QFN40 & LGA40 #28 (USB_D-) / #29 (USB_D+) |
| ESP32-C6 & ESP32-H2 | None | Yes | Built-in USB Serial/JTAG; check each series #pinout-title map & datasheet for exact D-/D+ pin numbers |
| ESP32-H21 (pending) | None | Yes | GPIO17 (D-) / GPIO18 (D+) via ESP-IDF; package pin numbers pending |
| ESP32-H4 (pending) | Full-speed | Yes | FS OTG + Serial/JTAG confirmed in ESP-IDF; package pin numbers pending |
4. In-Package Flash / Octal PSRAM Reserved Pins & EPAD Grounding
In-package memory is the single most common source of broken custom PCBs. On ESP32-S3 Octal PSRAM variants (such as ESP32-S3-PICO-1-N8R8, ESP32-S3R8, and ESP32-S3R16V, plus WROOM-1-N4R8/N8R8/N16R8/N16R16VA), GPIO33–GPIO37 (#38–#42 on LGA56/QFN56) and SPICS1 (#28) are permanently consumed by the 8-line PSRAM bus and marked unavailable in src/data/pinouts.ts. Quad-PSRAM variants (-R2) only reserve SPICS1 (#28), leaving GPIO33–GPIO37 free.
Similarly, on ESP32-PICO-D4 (#25 IO16, #27 IO17, #30–#33 CMD/CLK/SD0/SD1) and ESP32-PICO-V3-02 (#28–#31 SD2/SD3/CMD/CLK), internal flash/PSRAM traces carry explicit warnings against external use. On newer chips with in-package flash such as ESP32-C3FH4X/FH4AZ (#19–#24 NC), ESP32-C5HF4 (#26–#32 NC, keeping #25 SPICS1), ESP32-C5NF8R2LA (#25–#32 NC), ESP32-C61HF4 (#20, #22–#27 NC), and ESP32-C61NF8R8LA (#19, #20, #22–#27 NC), Espressif converts those unused SPI pins to NC rather than repurposing them as GPIOs.
Every single one of the 24 verified QFN and LGA packages places a central exposed thermal/ground pad (EPAD) at the last pin index (from #25 on 24-pin QFN24 up to #105 on 104-pin QFN104). Solder the EPAD directly to the main PCB GND plane via a dense thermal-via array, and on ESP32-C5 QFN48/LGA48 additionally connect perimeter RF ground pads #2, #43, and #47 right next to ANT_2G (#42) and ANT_5G (#48).
| Pinout Definition | Perimeter + EPAD | Warning Pins | In-Package Memory & NC Exceptions |
|---|---|---|---|
| ESP32-S3 QFN56 / PICO-N8R8 | 56 + #57 GND | 21 | Octal PSRAM locks #28 (SPICS1) and #38–#42 (GPIO33–37); #30–#35 & #53–#54 NC on S3-PICO-1 |
| ESP32-P4 QFN104 v3.x / v1.x | 104 + #105 GND | 7 | Dedicated #27–#33 FLASH_*; Pin 54 is VDD_HP_1 on v3.x X SKUs vs NC on legacy v1.x |
| ESP32-S31 QFN80 | 80 + #81 GND | 11 | In-package 1.8 V Octal PSRAM uses dedicated rails (#30, #34, #35); #36–#42 SPI flash |
| ESP32-C5 QFN48 / LGA48 | 48 + #49 GND | 13 | C5HF4 sets #26–#32 NC (keeps #25 SPICS1); C5NF8R2LA LGA48 sets #25–#32 NC |
| ESP32-C61 QFN40 / LGA40 | 40 + #41 GND | 13 | C61HF4 sets #20, #22–#27 NC (keeps #19 SPICS1); C61NF8R8LA LGA40 sets #19, #20, #22–#27 NC |
| ESP32-C3 QFN32 / ESP8685 QFN28 | 32 + #33 / 28 + #29 | 11 | C3FH4X/AZ (16 GPIO) sets #19–#24 NC; ESP8685 QFN28 (15 GPIO) sets #19–#20 NC |
Frequently Asked Questions
Why can I not use GPIO33–GPIO37 on ESP32-S3-WROOM-1-N8R8 or S3-PICO-1-N8R8?
Ordering codes containing R8, R16V, or R16VA pair the ESP32-S3 with Octal SPI PSRAM, which physically occupies SPICS1 (#28) and GPIO33–GPIO37 (#38–#42). Quad PSRAM (-R2) and PSRAM-less (-N4/-N8/-N16) variants leave GPIO33–GPIO37 available.
Which ESP32 chips expose native USB pins without needing a UART bridge?
Only original ESP32 and ESP32-C2 (ESP8684) lack native USB. Every other production series—S2, S3, S31, P4, C3, C5, C6, C61, H2 (plus H21 and H4)—includes either native USB OTG, USB Serial/JTAG, or both.
What happens if CHIP_PU or CHIP_EN is left floating on a custom PCB?
Every verified pinout marks CHIP_PU / CHIP_EN with a strict hardware warning: leaving it floating causes unreliable power-on resets, brownout loops, or complete boot failure. Always implement the RC power-up delay circuit specified in the series datasheet.
Why do ESP32-E22, ESP32-H21, and ESP32-H4 show pending pinouts?
As of 2026-11-18, Espressif has not published public package pin tables or datasheets for these three pre-production series on documentation.espressif.com. Rather than guessing pad numbering from partial ESP-IDF headers, esp.run keeps them explicitly pending.
Does the QFN/LGA center pad (EPAD) always need to be soldered to GND?
Yes. All 24 verified QFN and LGA pinouts in src/data/pinouts.ts define the center EPAD as GND. It serves as both the primary RF/digital ground reference and the thermal dissipation path.