Skip to content

espressif: add optional ESP-Hosted Wi-Fi on ESP32-P4 - #11502

Open
ladyada-eagleclaw wants to merge 1 commit into
fix-sdio-slot-lifetimefrom
add-esp32p4-hosted-wifi
Open

ladyada-eagleclaw wants to merge 1 commit into
fix-sdio-slot-lifetimefrom
add-esp32p4-hosted-wifi

Conversation

@ladyada-eagleclaw

@ladyada-eagleclaw ladyada-eagleclaw commented Oct 3, 2026 •

Copy link
Copy Markdown

AI-assisted with Codex, asked to bring up the Metro ESP32-P4's C6 coprocessor through CircuitPython's standard Wi-Fi APIs. This PR extracts only ESP-Hosted integration from #11497; the Metro wiring is in the separate board PR.

What

Add optional ESP-Hosted Wi-Fi to ESP32-P4 boards. CIRCUITPY_ESP_HOSTED=1 enables the existing wifi, socketpool and SSL implementation with the remote radio; each board provides its SDK transport configuration.

Pin ESP-Hosted v2.12.13 and an upstream esp-wifi-remote commit (component 1.6.5), wire them into dependency/build selection, select the remote Wi-Fi headers, initialize Hosted once, and retain the SDIO/control pins across VM reloads. Reserve the Hosted SDMMC slot so sdioio selects the other slot. Keep dependency selection consistent during automatic CMake regeneration.

Dependency

This PR is stacked on #11500 (fix-sdio-slot-lifetime), which contains the separately reviewed controller/slot cleanup and SDK prerequisites. Its diff contains only the Hosted integration. The unrelated SD frequency-unit correction, USB host, ADC, UID, ROM reset and DSI fixes are separate PRs.

Validation

Metro ESP32-P4 Rev A, silicon v0.1, 16 MB flash/PSRAM, with C6 firmware ESP-Hosted 2.12.11. AP scans, connection/DHCP, gateway ping, DNS resolution and HTTP 200 passed. After normal reboot, safe-mode reason was NONE, gateway ping was 19 ms and the HTTP response was HTTP/1.1 200 OK.

The same integrated firmware passed concurrent SD-card read/write verification and 24 mount/read/unmount/deinit cycles while Wi-Fi scanned, then returned to the USB keyboard/DSI demo. These are serial and hardware observations, not simulated results. Credentials were not added to the source or PR.

Recombining the eight issue-specific changes and the board definition reproduces all 29 affected paths from the tested integration tree byte for byte. That recombined tree builds on current main (35210c2e31) with make -C ports/espressif BOARD=adafruit_metro_esp32p4 BUILD=build-metro-p4-c6-final -j6: 1,536,144 bytes used and 561,008 bytes free in the 2 MiB firmware partition. Earlier integrated builds also passed for the other five P4 configurations and an ESP32-S3. This is a combined build with the separately submitted Metro wiring, not a claim of a standalone hardware test of the extracted PR. Changed-file pre-commit and git diff --check pass. The C6 firmware was not modified. BLE, ESP-NOW, TLS validation and other coprocessor/transport combinations are not claimed.

Use remote Wi-Fi components and preserve the configured SDIO transport across VM reloads. Reserve its slot from sdioio allocation. Board wiring remains in the board definition.

Co-authored-by: Limor Fried <ladyada@users.noreply.github.com>
@mikeysklar

mikeysklar commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Metro CI fails with "No SOURCES given to target: __idf_esp-hosted". CI never fetches esp-hosted's nested protobuf-c submodule. Same fix as mbedtls in tools/ci_fetch_deps.py?

    esp_hosted = TOP / "ports" / "espressif" / "esp-hosted"
    if (esp_hosted / ".gitmodules").exists():
        depth_maybe = "" if clone_supports_filter else "--depth 1"
        run(
            "Init esp-hosted nested submodules",
            f"git submodule update --init {filter_maybe} {depth_maybe} common/protobuf-c",
            cwd=esp_hosted,
        )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants