Skip to content

fix(esp32/parlio): CONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 default in boards.py - #3276

Merged
zackees merged 1 commit into
masterfrom
fix/esp32-parlio-iram-default
Jun 19, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/esp32-parlio-iram-default

Conversation

@zackees

@zackees zackees commented Jun 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds -DCONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 and -DCONFIG_PARLIO_TX_ISR_CACHE_SAFE=1 to every PARLIO-capable ESP32 board definition in ci/boards.py (C5, C6, H2, P4, S3) via a new shared _ESP32_PARLIO_BUILD_FLAGS constant. The next PARLIO-capable target added cannot silently miss them — the constant is spread into each board's build_flags.

Why

Without these macros the PARLIO TX ISR sits in flash and can take cache-miss stalls during execution, long enough to violate LED protocol timing. The driver already #warnings when the IRAM flag is absent (src/platforms/esp/32/drivers/parlio/parlio_peripheral_esp.cpp.hpp:46-48), but the warning was easy to miss because the flag reached CI only for esp32c6 via the implicit root-platformio.ini merge (ci/compiler/pio.py:155). Every other PARLIO-capable board (S3/H2/P4/C5) was compiling without it.

Why root platformio.ini is intentionally left alone

The duplicate -D lines under [env:esp32c6] in root platformio.ini are NOT removed. Root platformio.ini is an orthogonal surface used by interactive bash debug / bash autoresearch / raw pio run, and must stay self-sufficient. Severing the root-merge from the CI compile path is tracked separately in #3274; this PR is the Phase 1 prep that makes that sever safe.

Files changed

  • ci/boards.py — added _ESP32_PARLIO_BUILD_FLAGS constant; wired into ESP32_C5_DEVKITC_1, ESP32_C6_DEVKITC_1, ESP32_S3_DEVKITC_1, ESP32H2, ESP32_P4 (+18 / -0).

Test plan

  • bash lint — clean
  • uv run python -c "from ci.boards import ..." smoke test — confirms all 5 PARLIO boards now carry both flags
  • CI compile of esp32c6 / esp32s3 via the normal bash compile path — should NOT emit the parlio_peripheral_esp.cpp.hpp:46 #warning for any PARLIO board

Closes #3271
Refs #3274

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Centralized PARLIO ESP32 build-time flags into a shared configuration, reducing duplication across board definitions and improving maintainability.

…ds.py default

Adds `-DCONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1` and
`-DCONFIG_PARLIO_TX_ISR_CACHE_SAFE=1` to every PARLIO-capable ESP32
board definition in `ci/boards.py` (C5, C6, H2, P4, S3) via a new
shared `_ESP32_PARLIO_BUILD_FLAGS` constant so the next PARLIO target
added cannot silently miss them.

Without these macros the PARLIO TX ISR sits in flash and can take
cache-miss stalls during execution — long enough to violate LED
protocol timing. The driver already warns at compile time when the
IRAM flag is absent (src/platforms/esp/32/drivers/parlio/
parlio_peripheral_esp.cpp.hpp:46-48), but the warning was easy to
miss because the flag reached CI only for esp32c6, via the implicit
root-`platformio.ini` merge (ci/compiler/pio.py:155). Every other
PARLIO-capable board (S3/H2/P4/C5) was compiling without it.

The duplicate `-D` lines under `[env:esp32c6]` in root `platformio.ini`
are intentionally left in place — root `platformio.ini` is an
orthogonal surface used by interactive `bash debug` / `bash autoresearch`
and must remain self-sufficient. Severing the root-merge from CI is
tracked separately in #3274 (this PR is the Phase 1 prep that makes
the sever safe).

Closes #3271
Refs #3274

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1f8b4214-a214-41c5-91f2-25c7eef5cd00

📥 Commits

Reviewing files that changed from the base of the PR and between dc9a0d4 and e0cb054.

📒 Files selected for processing (1)
  • ci/boards.py

📝 Walkthrough

Walkthrough

ci/boards.py introduces a shared _ESP32_PARLIO_BUILD_FLAGS list containing two PARLIO compile-time defines (CONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 and CONFIG_PARLIO_TX_ISR_CACHE_SAFE=1). This constant is then applied to five PARLIO-capable ESP32 board definitions: ESP32_C5_DEVKITC_1, ESP32_C6_DEVKITC_1, ESP32_S3_DEVKITC_1, ESP32H2, and ESP32_P4.

Changes

PARLIO Build Flag Centralization

Layer / File(s) Summary
Shared PARLIO flags constant and board updates
ci/boards.py
Adds _ESP32_PARLIO_BUILD_FLAGS list with IRAM-placement and cache-safe -D defines. ESP32_C5_DEVKITC_1 and ESP32H2 set build_flags directly from this list; ESP32_C6_DEVKITC_1, ESP32_S3_DEVKITC_1, and ESP32_P4 prepend the shared flags into their existing build_flags arrays via unpacking.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#2515: Adds the ESP32 clockless PARLIO driver whose FASTLED_ESP32_HAS_PARLIO code paths are gated on the same -D defines now being centralized.
  • FastLED/FastLED#2564: Introduces the FL_PARLIO_EAGER_QUEUE compile-time option, directly dependent on the PARLIO build flags this PR propagates across all boards.

Poem

🐇 Hop, hop, a flag for each board,
No more ISRs lost in the flash-ward!
IRAM placement, cache-safe too,
Shared constant keeps the build flags true.
This rabbit tidied every -D line,
And now the LED timing will shine! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title accurately describes the main change: adding CONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 defaults to ESP32 boards in boards.py.
Linked Issues check ✅ Passed PR successfully implements all coding objectives from #3271: creates shared _ESP32_PARLIO_BUILD_FLAGS constant and applies it to all five PARLIO-capable boards (ESP32-C5, C6, S3, H2, P4) identified in the issue.
Out of Scope Changes check ✅ Passed All changes remain in ci/boards.py focused on adding PARLIO flags to board definitions; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/esp32-parlio-iram-default

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees
zackees merged commit 7a719c0 into master Jun 19, 2026
11 checks passed
@zackees
zackees deleted the fix/esp32-parlio-iram-default branch June 19, 2026 19:10
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 19, 2026
zackees added a commit that referenced this pull request Jun 19, 2026
… exception_decoder (#3277)

Adds two new optional fields to the `Board` dataclass:

  - `monitor_filters: list[str] | None` — serial monitor decoders/filters
  - `check_tool: str | None`            — `pio check` static-analysis tool

ESP32-family boards (board_name or real_board_name starting with "esp32")
auto-default `monitor_filters` to `["default", "esp32_exception_decoder"]`
inside `Board.to_platformio_ini()` so that under `bash debug` and other
flows that consume the synthesised `.build/pio/<env>/platformio.ini`,
crash backtraces decode to file:line without depending on the root
`platformio.ini` merge that `ci/compiler/pio.py:155` performs today.

The auto-default matches the existing pattern used for QEMU flash-mode
detection further up in the same method. A board can suppress the
auto-default by setting `monitor_filters=[]`, or override it by setting
a custom list. `check_tool` is opt-in per-board (no auto-default)
because it only affects `pio check`, not the compile path.

Root `platformio.ini` is deliberately left untouched — the two surfaces
are orthogonal and both audiences (CI via boards.py; interactive
`bash debug` / `bash autoresearch` / `pio run` via root) need the
filters declared in their own file.

This is Phase 1 of #3274 (sever root `platformio.ini` from CI compile
path). The other Phase 1 item — PARLIO IRAM flag — is in PR #3276.

Refs #3274

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request Jun 20, 2026
…y bit (#3304) (#3306)

The PARLIO IRAM build flags (CONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM,
CONFIG_PARLIO_TX_ISR_CACHE_SAFE) in ci/boards.py were applied via a
hand-maintained allowlist that spread _ESP32_PARLIO_BUILD_FLAGS into each
PARLIO-capable board's build_flags. PR #3276 originally included esp32s3
in that list incorrectly — S3 has no PARLIO peripheral (SOC_PARLIO_SUPPORTED
is unset in its soc_caps.h) — and that bug shipped to master.

Switch to a capability-driven model that mirrors the existing
auto-detection pattern used for ESP32 monitor_filters:

- Add `parlio_capable: bool = False` to the Board dataclass, documented
  to track Espressif's SOC_PARLIO_SUPPORTED capability bit and to be
  kept in sync with src/platforms/esp/32/drivers/parlio/bus_traits.h:6.
- Auto-prepend _ESP32_PARLIO_BUILD_FLAGS in Board.to_platformio_ini()
  when parlio_capable is True. The constant stays as the single source
  of truth for the two flag values.
- Set parlio_capable=True on ESP32_C5_DEVKITC_1, ESP32_C6_DEVKITC_1,
  ESP32H2, ESP32_P4 and drop the manual spread from their build_flags.
- Remove the bogus *_ESP32_PARLIO_BUILD_FLAGS spread from
  ESP32_S3_DEVKITC_1 (the #3276 bug) and add a comment warning against
  regressing it.

Add a snapshot test (ci/tests/test_parlio_capable_boards.py) that pins:
- The parlio_capable set equals {esp32c5, esp32c6, esp32h2, esp32p4}.
- esp32s3.to_platformio_ini() contains no PARLIO flag.
- Every parlio_capable board's ini carries both IRAM flags.

Out of scope (per #3304): auto-deriving from a parsed copy of ESP-IDF's
soc_caps.h is deferred to a follow-up.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

esp32: CONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 should be a boards.py default on all PARLIO-capable boards

1 participant