Repository navigation
fix(esp32/parlio): CONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 default in boards.py - #3276
Conversation
…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]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesPARLIO Build Flag Centralization
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
… 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]>
…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
Summary
Adds
-DCONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1and-DCONFIG_PARLIO_TX_ISR_CACHE_SAFE=1to every PARLIO-capable ESP32 board definition inci/boards.py(C5, C6, H2, P4, S3) via a new shared_ESP32_PARLIO_BUILD_FLAGSconstant. The next PARLIO-capable target added cannot silently miss them — the constant is spread into each board'sbuild_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 foresp32c6via the implicit root-platformio.inimerge (ci/compiler/pio.py:155). Every other PARLIO-capable board (S3/H2/P4/C5) was compiling without it.Why root
platformio.iniis intentionally left aloneThe duplicate
-Dlines under[env:esp32c6]in rootplatformio.iniare NOT removed. Rootplatformio.iniis an orthogonal surface used by interactivebash debug/bash autoresearch/ rawpio 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_FLAGSconstant; wired intoESP32_C5_DEVKITC_1,ESP32_C6_DEVKITC_1,ESP32_S3_DEVKITC_1,ESP32H2,ESP32_P4(+18 / -0).Test plan
bash lint— cleanuv run python -c "from ci.boards import ..."smoke test — confirms all 5 PARLIO boards now carry both flagsbash compilepath — should NOT emit theparlio_peripheral_esp.cpp.hpp:46#warningfor any PARLIO boardCloses #3271
Refs #3274
🤖 Generated with Claude Code
Summary by CodeRabbit