Skip to content

feat(espidf): move the delegated ESP-IDF pin to v5.5.2+ so ESP32-P4 rev-3 silicon builds #2133

Closed

Description

@zackees

Context

The delegated ESP-IDF build (board_build.build_system = espidf, crates/fbuild-build-esp/src/esp32/espidf_delegate.rs) pins one release, ESP-IDF v5.5.1 (IDF_RELEASE_VERSION in crates/fbuild-toolchain/src/toolchain/esp_idf_release.rs). It now serves the RISC-V targets as well as esp32s3, but v5.5.1 cannot target ESP32-P4 rev-3 silicon:

  • v5.5.1 components/esp_hw_support/port/esp32p4/Kconfig.hw_support has ESP32P4_REV_MAX_FULL default 199 and no ESP32P4_REV_MIN_300 choice.
  • v5.5.2 adds ESP32P4_SELECTS_REV_LESS_V3 and ESP32P4_REV_MIN_300, with ESP32P4_REV_MAX_FULL 399 when the rev-3 family is selected.

So reject_unsupported_silicon refuses any ESP32-P4 board whose SDK variant is not esp32p4_es (today: esp32-p4_r3) before anything is downloaded. That is the honest behaviour for the current pin, and it is a gap: rev-3 boards have no bare-IDF path.

Closed PR #1878 handled this with a second IDF pin (PlatformIO framework-espidf 5.5.5 for C5/P4) and a board-variant-to-Kconfig mapping (chip_variant=esp32p4 -> CONFIG_ESP32P4_REV_MIN_300=y, esp32p4_es -> CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y / CONFIG_ESP32P4_REV_MIN_0=y). That adapter was not landed (decision recorded in docs/design/bare-idf-component-builds.md, "RISC-V targets and the native-adapter decision"); its source is retained on origin/feat/espidf-s3-round1 (crates/fbuild-build-esp/src/esp32/orchestrator/idf/packages.json and project.rs) as the reference for the mapping.

Proposal

Move the delegated path's single pin to an ESP-IDF release that supports both ESP32-P4 silicon families (v5.5.2 or later), then select the family from the board:

  1. Bump IDF_RELEASE_VERSION / IDF_RELEASE_COMMIT, the source archive + submodule pins (esp_idf_source.rs), the Python constraints/lock (esp_idf_python.rs) and every tools.json pin (esp_idf_release.rs). One release, not two: a second pin would bring back the two-stacks problem feat(esp32): build ESP-IDF-only applications across Xtensa and RISC-V targets #1878 was closed over.
  2. Replace the rev-3 refusal with a board-derived default: pass the silicon family to the IDF build (for example an fbuild-owned SDKCONFIG_DEFAULTS entry that precedes the project's own), and reject a project sdkconfig that selects the other family.
  3. Re-run the delegated end-to-end tests for every listed chip on the new pin, and add esp32p4-r3 to the building set in tests/platform/espidf_component_riscv.

Acceptance criteria

  • RED: fbuild build tests/platform/espidf_component_riscv -e esp32p4-r3 fails with the rev-3 refusal (current behaviour).
  • GREEN: the same command builds, and the generated sdkconfig has CONFIG_ESP32P4_REV_MIN_FULL=300; -e esp32p4 still builds with a pre-rev-3 range.
  • The esp32s3, esp32c3, esp32c5 and esp32c6 delegated end-to-end tests pass on the new pin.
  • Installed-size constants and the footprint table in docs/reference/platformio-ini.md are re-measured.
  • No second IDF release is pinned.

Not in scope

  • Hardware validation on P4 boards (neither family has been booted from a delegated image).
  • esp32, esp32s2, esp32c2 and esp32h2, which are refused because no project has been built for them through this path.

Refs #1878, #1761, #1970.

Activity

  1. zackees commented on Nov 22, 2026

    @zackees
    MemberAuthor

    Stage 0 is up as PR #2146 (not a pin move): the PINS table is now checked against the pinned release's own tools/tools.json, committed verbatim at crates/fbuild-toolchain/data/esp-idf-v5.5.1-tools.json. So the AC1 bump becomes a reviewable data diff instead of 30 hand-copied sha256 rows, and a drifted row fails with its name in the message.

    Two measurements that came out of writing it:

    • All 30 current PINS rows match v5.5.1's tools.json exactly (version, sha256, size, URL) — the existing copy is clean.
    • v5.5.1's tools.json publishes no linux-arm64 ninja archive (keys: linux-amd64, macos, macos-arm64, win64), so a delegated build on an arm64 Linux host has pinned cmake and pinned toolchains but no pinned ninja. Outside this issue's cells, but the bump's e2e matrix should not assume ninja exists on arm64.

    Remaining cells here (version/commit/PINS/Python-lock bump to v5.5.2+ — v5.5.6 is newest; board-derived P4 silicon family; re-measured installed sizes; five-chip e2e) still need a dedicated multi-step track rather than a 25-minute steward tick: the pin bump alone re-resolves the hash-locked Python env and re-measures a ~3.4 GB release.

  2. zackees commented on Nov 22, 2026

    @zackees
    MemberAuthor

    Steward sizing note (2026-11-22, no code change here):

    Re-measured on origin/main b165732b so the next taker does not have to:

    • IDF_RELEASE_VERSION is still v5.5.1 (crates/fbuild-toolchain/src/toolchain/esp_idf_release.rs L35), and PINS (L339-588) is a hand-copied table of 30 rows across 7 components (xtensa-esp-elf 5, riscv32-esp-elf 5, openocd-esp32 5, cmake 5, ninja 4, esp32ulp-elf 5, esp-rom-elfs 1) with no generator — every row that moves needs its sha256 and bytes re-captured from the real archive.
    • Upstream esp-idf tag v5.5.6 exists (ref 28871d80f730e6976c9bdc9c4cbff1c916e905a9), so the target release is available; the earlier note that v5.5.1's tools.json ships no linux-arm64 ninja archive still stands, so the e2e matrix must not assume ninja on arm64.
    • Acceptance also needs installed-size constants and the footprint table in docs/reference/platformio-ini.md re-measured, plus delegated e2e builds for esp32s3/c3/c5/c6/p4 — a multi-GB download and five ESP-IDF project builds.

    That is not a one-hour steward tick on this host (load 15-22 on 16 cores, and a fresh worktree's first -p fbuild-toolchain test alone has cost ~85 min). Not blocked on anything external and not deferred — just too large to start half-way: a partial PINS bump without the re-measured sizes and the e2e matrix would be worse than none. This tick the steward took #2151 (CLI fbuild reset bypassing daemon device-lease admission), which was the next actionable item.

  3. zackees commented on Nov 23, 2026

    @zackees
    MemberAuthor

    Stage delivered: PR #2161 moves the delegated pin from v5.5.1 to v5.5.6 (the newest patch of the same line) and selects the ESP32-P4 silicon family from the board's build.chip_variant via an fbuild-owned SDKCONFIG_DEFAULTS entry that precedes the project's own:

    • chip_variant = esp32p4 → CONFIG_ESP32P4_REV_MIN_300=y (ESP32P4_REV_MIN_FULL=300)
    • chip_variant = esp32p4_es → CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y + CONFIG_ESP32P4_REV_MIN_0=y
    • a project sdkconfig that pinned the other family is now a configuration error naming the file and symbol; a P4 board naming neither family is refused by name.

    Data moved with it: tool pins (xtensa/riscv32 GCC 20241119→20260121, esp-rom-elfs 20241011→20260528, openocd 20250707→20260831; cmake/ninja/ulp unchanged), source tree commit fcae3288→880a203a with 18 of 23 gitlinks re-hashed, the Python lock re-resolved against v5.5.6's constraints (esptool 4.14.0), and installed sizes re-measured with du -sb (method validated by reproducing v5.5.1's committed xtensa constant byte-for-byte). v5.5.6 also publishes a linux-arm64 ninja, so an arm64 Linux host can now pin every component.

    Verified here: fbuild-toolchain lib 214 passed / 0 failed / 6 ignored; fbuild-build-esp lib 269 passed / 0 failed / 7 ignored; fmt clean; boundary rows=0; dylint_rows=0.

    Still open on this issue: the five-chip delegated e2e runs (each installs 1.8-2.8 GB and runs a real idf.py build — all #[ignore]; the rev-3 refusal e2e became a two-board build proof asserting CONFIG_ESP32P4_REV_MIN_FULL=300 and =0), plus the released footprint table in docs/reference/platformio-ini.md.

  4. zackees commented on Nov 23, 2026

    @zackees
    MemberAuthor

    Stage delivered: PR #2163 — and it fixes a regression #2161 introduced.

    #2161 wrote the P4 SDKCONFIG_DEFAULTS entry into <build>/idf, the directory idf.py owns. idf.py set-target implies fullclean, which IDF refuses to run on a non-empty directory that is not a CMake build tree, so every ESP32-P4 delegated build died at set-target before compiling anything. Non-P4 chips were unaffected (no family defaults → empty build root), and the unit tests only ever checked the file's name and content, so #2161's suite stayed green.

    #2163 moves the defaults to <build>/fbuild-idf-defaults/ (sibling of the IDF build root) and adds a placement test.

    Measured here, linux-amd64, v5.5.6 pin, FBUILD_IDF_PROOF_CACHE:

    • espidf_riscv_component_project_builds_for_both_p4_silicon_families: FAILED 27.18 s (set-target exit 2) before, ok 77.04 s after — rev-3 image has CONFIG_ESP32P4_REV_MIN_FULL=300, pre-rev-3 board =0.
    • All five chip proofs now pass on the new pin: esp32s3 168.97 s, esp32p4 both families 77.04 s, esp32c3 + c5 + c6 69.21 s.

    This also closes the issue's last AC, the footprint re-measure (du -sb over the install cache): 2.10 GB for Xtensa and 3.09 GB for RISC-V, against the 1.8 / 2.8 GB the reference doc carried. Table updated in docs/reference/platformio-ini.md; the design note keeps its v5.5.1 measurement and records the re-measure beside it. Still one IDF_RELEASE_VERSION — no second pin.

    #2133 closes when #2163 merges.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions