Skip to content

fix(ci/boards): set PARLIO TX ISR IRAM flags on all PARLIO-capable boards (#3271) - #3275

Closed
davidcreated wants to merge 4 commits into
FastLED:masterfrom
davidcreated:fix/parlio-isr-iram-boards-3271
Closed

davidcreated wants to merge 4 commits into
FastLED:masterfrom
davidcreated:fix/parlio-isr-iram-boards-3271

Conversation

@davidcreated

@davidcreated davidcreated commented Jun 19, 2026 •

Copy link
Copy Markdown

Summary

Fixes #3271.

CONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 and CONFIG_PARLIO_TX_ISR_CACHE_SAFE=1 are required for correct PARLIO TX ISR behavior. Without them the ISR sits in flash, takes cache-miss stalls during execution, and violates LED protocol timing — the driver only signals this with a compile-time #warning (src/platforms/esp/32/drivers/parlio/parlio_peripheral_esp.cpp.hpp:46-48).

Today these flags live only in the root platformio.ini [env:esp32c6] block. CI gets them by accident via the root-merge in PioCompiler._init_platformio_build — and only for esp32c6. Every other PARLIO-capable board (esp32s3, esp32h2, esp32p4, esp32c5) compiles without them today.

Change

  • Extract a shared ESP32_PARLIO_BUILD_FLAGS constant in ci/boards.py.
  • Apply it to the build_flags of every PARLIO-capable board: esp32c5, esp32c6, esp32s3, esp32h2, esp32p4.

This makes ci/boards.py a self-sufficient source of truth ahead of the planned root-platformio.ini sever, and ensures the next PARLIO board added cannot silently miss the flags (just spread the shared constant).

Scope note

The root platformio.ini [env:esp32c6] flags are intentionally left in place. That env is still used for standalone manual pio run (which does not go through boards.py), and the root-merge removal it depends on is tracked as separate follow-up work in #3271. Removing them now would regress standalone dev builds before the sever lands. The duplicate -D on the c6 CI build is harmless.

Verification

Rendered each board's to_platformio_ini() and confirmed both flags are present:

esp32c5      IRAM=True CACHE_SAFE=True
esp32c6      IRAM=True CACHE_SAFE=True
esp32s3      IRAM=True CACHE_SAFE=True
esp32h2      IRAM=True CACHE_SAFE=True
esp32p4      IRAM=True CACHE_SAFE=True

python3 -m py_compile ci/boards.py passes.

Summary by CodeRabbit

Release Notes

  • Chores
    • Standardized PARLIO-related compiler flags across all PARLIO-capable ESP32 board variants (C5, C6, S3, H2, and P4) to ensure consistent build behavior.
    • Exposed a shared, reusable set of build flags for PARLIO so each board applies the same ISR placement and cache-safety settings.

…271)

CONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 and CONFIG_PARLIO_TX_ISR_CACHE_SAFE=1
are required for correct PARLIO TX ISR timing — without them the ISR sits in
flash and takes cache-miss stalls mid-execution, violating LED protocol
timing. The driver only emits a compile-time #warning when the flag is missing.

Previously these flags lived only in the root platformio.ini [env:esp32c6]
block. CI picked them up by accident via the root-merge in PioCompiler, and
only for esp32c6 — every other PARLIO-capable board (esp32s3, esp32h2,
esp32p4, esp32c5) compiled without them.

Extract a shared ESP32_PARLIO_BUILD_FLAGS constant and apply it to the
build_flags of every PARLIO-capable board in ci/boards.py, so boards.py is a
self-sufficient source of truth ahead of the planned root-platformio.ini
sever, and so the next PARLIO board added cannot silently miss the flags.

Root platformio.ini is left intact: that env is still used for standalone
manual `pio run` (which does not go through boards.py), and the root-merge
removal it depends on is tracked as separate follow-up work.
@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: 3471b843-c44e-44d9-a89c-604a2bc0097e

📥 Commits

Reviewing files that changed from the base of the PR and between 21a6a55 and 4307961.

📒 Files selected for processing (1)
  • ci/boards.py
💤 Files with no reviewable changes (1)
  • ci/boards.py

📝 Walkthrough

Walkthrough

A new module-level constant ESP32_PARLIO_BUILD_FLAGS is added to ci/boards.py containing two compile-time -D defines for PARLIO TX ISR IRAM/cache-safe placement. This constant is then unpacked into the build_flags list of five PARLIO-capable ESP32 board definitions: C5, C6, S3, H2, and P4.

Changes

PARLIO build flags for ESP32 boards

Layer / File(s) Summary
PARLIO flags constant definition
ci/boards.py
Adds public ESP32_PARLIO_BUILD_FLAGS constant with -DCONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 and -DCONFIG_PARLIO_TX_ISR_CACHE_SAFE=1.
PARLIO flags applied to boards
ci/boards.py
Spreads ESP32_PARLIO_BUILD_FLAGS into the build_flags of ESP32-C5, C6, S3, H2, and P4 board definitions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • FastLED/FastLED#3276: Both PRs centralize and apply the same PARLIO TX ISR build flags (-DCONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 and -DCONFIG_PARLIO_TX_ISR_CACHE_SAFE=1) to the same set of PARLIO-capable ESP32 boards in ci/boards.py.

Poem

🐇 Hop hop, the flags are set,
No IRAM cache miss, no timing threat!
C5, C6, S3 in a row,
H2 and P4 join the show.
The rabbit says: compile with care,
#warning silenced — flags are there! ✨

🚥 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 The title accurately describes the main change: setting PARLIO TX ISR IRAM flags on all PARLIO-capable boards and extracting a shared constant.
Linked Issues check ✅ Passed All primary objectives from #3271 are met: extracted ESP32_PARLIO_BUILD_FLAGS constant and applied it to all five PARLIO-capable boards (esp32c6, esp32s3, esp32h2, esp32p4, esp32c5).
Out of Scope Changes check ✅ Passed All changes in ci/boards.py are directly related to applying PARLIO TX ISR flags to PARLIO-capable boards, with no unrelated modifications.
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 unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ci/boards.py`:
- Around line 42-45: Add an explicit type annotation to the
ESP32_PARLIO_BUILD_FLAGS constant at the module level. Since this constant is
assigned a list of strings, add a type annotation indicating it is a list of
strings (list[str]) between the constant name and the assignment operator. This
will improve type safety and IDE support for the codebase.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4d3c10f3-1fb9-41e5-be41-6261d5d86e24

📥 Commits

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

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

Comment thread ci/boards.py Resolved
Address CodeRabbit review on #3275: add explicit type annotation to the
module-level constant for type safety and IDE support.
@davidcreated

Copy link
Copy Markdown
Author

Addressed in 1947d37 — added the explicit list[str] annotation to ESP32_PARLIO_BUILD_FLAGS. Thanks @coderabbitai.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@davidcreated Thanks for the update! The explicit list[str] annotation on ESP32_PARLIO_BUILD_FLAGS makes the intent clear and improves type safety.

(๑˃ᴗ˂)ﻭ


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ci/boards.py`:
- Line 856: Fix the duplicate keyword argument errors in three Board
constructors by merging the PARLIO build flags into a single build_flags list.
In the ESP32_C5_DEVKITC_1 constructor, combine the existing build_flags list
with the PARLIO flags and remove the second build_flags argument. Do the same
for the ESP32H2 constructor and the ESP32_P4 constructor, ensuring each Board
call has only one build_flags parameter that includes both the original flags
and the PARLIO flags merged together using list concatenation or unpacking
syntax.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f9b7b111-ac1d-4888-b136-afd927ea8802

📥 Commits

Reviewing files that changed from the base of the PR and between 1947d37 and 21a6a55.

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

Comment thread ci/boards.py Resolved
@zackees

zackees commented Jun 20, 2026

Copy link
Copy Markdown
Member

Thank you for the contribution @davidcreated! Closing as superseded — your fix was correct in intent and just lost the race to a parallel effort by an hour or so. The PARLIO IRAM lockdown has now landed on master across a sequence of PRs:

Net result on master: every PARLIO-capable board (C5/C6/H2/P4) gets the IRAM + cache-safe flags automatically, S3 correctly does not, and a snapshot test (`ci/tests/test_parlio_capable_boards.py`) guards against future drift.

Really appreciate you taking the time to file this — same fix, just routed through a different shipping cycle.

@zackees zackees closed this Jun 20, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 20, 2026
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

2 participants