Skip to content

boards.py: derive PARLIO-capable board list from SOC_PARLIO_SUPPORTED, not a hand-maintained list #3304

Closed

Description

@zackees

Problem

The PARLIO IRAM flags in ci/boards.py (constant _ESP32_PARLIO_BUILD_FLAGS, spread into the build_flags of every PARLIO-capable board) are applied via a hand-maintained allowlist of board names: esp32c5, esp32c6, esp32h2, esp32p4. (My PR #3276 originally included esp32s3 too — incorrectly, since S3 has no PARLIO peripheral. That bug shipped to master because the list was a manual transcription instead of derived from a canonical source.)

The authoritative source of "which chips have PARLIO" is Espressif's SOC_PARLIO_SUPPORTED capability bit, set per-target in components/soc/<chip>/include/soc/soc_caps.h. FastLED already consumes it: FASTLED_ESP32_HAS_PARLIO = SOC_PARLIO_SUPPORTED (src/platforms/esp/32/feature_flags/enabled.h:135).

Today's drift risk:

  • A new Espressif chip ships with PARLIO. FastLED's driver code automatically picks it up because the driver is gated by FASTLED_ESP32_HAS_PARLIO. But ci/boards.py won't apply the IRAM flag to the new board — silent regression (the #warning in parlio_peripheral_esp.cpp.hpp:48 fires at compile time, easy to miss in CI noise).
  • A chip is added to FastLED's board list (ci/boards.py) but the maintainer forgets to add it to the PARLIO allowlist. Same silent regression.

Goal

Drive the PARLIO IRAM flag application from the SoC capability, not a hand-maintained list. Concretely:

  1. Add a parlio_capable (or soc_features) field to the Board dataclass in ci/boards.py. Default False.
  2. Set it explicitly on each PARLIO-capable board today (C5, C6, H2, P4). Mark it via a comment that points at the ESP-IDF SoC capability — "PARLIO peripheral: see soc_caps.h SOC_PARLIO_SUPPORTED".
  3. Board.to_platformio_ini() auto-applies _ESP32_PARLIO_BUILD_FLAGS when parlio_capable=True — no manual spread needed at the call site.
  4. (Stretch / cleaner): derive parlio_capable from a per-chip-family table (or fetch from a vendored copy of ESP-IDF's soc_caps.h parsed at codegen time) so adding a new PARLIO chip means updating one place (the SoC table), not auditing every board definition.

Acceptance criteria

  • ci/boards.py has no manual *_ESP32_PARLIO_BUILD_FLAGS spread at the call site of each PARLIO board — the flags are emitted by to_platformio_ini() based on a capability field.
  • Adding a new ESP32 chip to ci/boards.py requires touching ONE place to opt it into PARLIO flags (parlio_capable=True or its equivalent), not three places (the spread, the constant, the comment).
  • A snapshot test verifies that boards.py's PARLIO-capable set equals FastLED's driver allowlist (the four boards listed in src/platforms/esp/32/drivers/parlio/bus_traits.h:6 and channel_driver_parlio.cpp.hpp:8).
  • esp32s3 is NOT in the PARLIO set (it currently is — that's the bug surfaced in PR docs(channels): list supported chipsets in the fl::Bus enum table #3299).

Why this matters

The hand-maintained list has already caused one bug (esp32s3 incorrectly listed as PARLIO-capable in PR #3276; documented in PR #3299). The pattern of "drift between code-level capability flags and CI-side board lists" is exactly the kind of thing #3274 worked to eliminate for platformio.ini. Same medicine for PARLIO.

Refs

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