Add Adafruit Metro ESP32-P4 board - #11498
Conversation
Configure USB-C device, USB-A host, SDIO storage and the C6 Hosted coprocessor with the allocated Adafruit USB ID. Co-authored-by: Limor Fried <ladyada@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
VO4 is reacquired whenever board_init() repeats, leaving the LDO reference count unbalanced.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds the Adafruit Metro ESP32-P4 board definition with USB host, ESP-Hosted Wi-Fi, PSRAM, SDIO, and board pin mappings.
Changes:
- Configures ESP32-P4 flash, PSRAM, USB, and C6 Hosted Wi-Fi.
- Exposes board peripherals and enables the VO4 I/O rail.
| File | Description |
|---|---|
board.c |
Enables the 3.3 V VO4 rail. |
mpconfigboard.h |
Defines board buses and USB controllers. |
mpconfigboard.mk |
Configures memory and enabled features. |
pins.c |
Exposes board pin aliases and buses. |
sdkconfig |
Configures silicon revision and C6 SDIO Hosted transport. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Reviewed, looks good to me. The board CI build fails until esp-hosted's nested submodule is fetched, see #11502. |
Co-authored-by: Limor Fried <ladyada@users.noreply.github.com>
Retain the existing LDO handle across simulated deep-sleep wakes instead of adding another reference each time board_init runs. Co-authored-by: Limor Fried <ladyada@users.noreply.github.com>
|
@mikeysklar The nested dependency fix from #11502 is now included in the retained integration base (edeb01cc20) and merged into this branch without rewriting history. The PR diff remains the five board files. The updated board PR builds with |

AI-assisted with Codex, asked to add the Metro ESP32-P4 board and validate it on the physical prototype. The core changes are submitted separately; this PR contains only the five board-definition files.
Board
Adafruit Metro ESP32-P4 with 16 MB flash, 16 MB PSRAM, and an ESP32-C6 Wi-Fi coprocessor. USB VID/PID is the allocated Adafruit pair
239a:817c, recorded for Metro ESP32-P4 CircuitPython in Adafruit's boards repository.Dependency
This five-file PR remains based on the tested
metro-p4-core-supportintegration branch so its diff stays board-only and buildable. Core changes are now reviewed separately:After the dependencies merge, rebase the board commit onto
mainand retarget this PR. The aggregate core PR #11497 has been replaced by those issue-specific PRs; its branch is retained only as this PR's current integration base.Validation
Metro Rev A, silicon v0.1, Windows; ESP-Hosted 2.12.11 on the C6; 7-inch Raspberry Pi Touch Display 2 and USB keyboard
1c4f:0002.Hardware checks passed for the USB keyboard driving the DSI console, NeoPixel colors, all six analog input constructors/reads, pin aliases, an 8 MiB PSRAM allocation/pattern check, software entry to the ROM downloader, ordinary reboot, SDIO read/write verification at 20/40 MHz, and C6 Wi-Fi scanning/connection/ping/DNS/HTTP. Ladyada confirmed keyboard text on the display. The first prototype's SD card-detect hardware fault remains; this PR does not claim that signal passed.
The exact combined PR tree builds on current
mainwithmake -C ports/espressif BOARD=adafruit_metro_esp32p4 BUILD=build-metro-p4-c6-final -j4: 1,536,176 bytes used and 560,976 bytes free in the 2 MiB firmware partition. Changed-file pre-commit andgit diff --checkpass. The hardware checks above used the integrated development tree containing the identical board/core support.Minimal USB host check:
Observed:
['1c4f:0002']. The keyboard test does not measure high-speed USB throughput. BLE and camera integration are outside this board addition. Replaces the board portion of #11496.Review follow-up
c04d6043c8makes VO4 acquisition idempotent. The dependency-fetch fix from #11502 is merged through the retained base, preserving the five-file board diff. The updated board PR build uses 1,536,160 bytes with 560,992 bytes free. A host-side test of the actual board source calledboard_init()100 times and observed one acquisition. The identical board files were flashed in integration treeba6cace243(built before commit, reporting3732760035-dirty): five SD initialization/read/deinit cycles, 100 sector reads, a C6 scan finding 23 networks, demo restart and USB-C echo passed. Repeated hardware simulated-sleep cycles were not tested.