Skip to content

fix(esp32): remove Arduino console retention with native SDK backends - #4887

Merged
zackees merged 2 commits into
feat/esp32-rmt4-async-legacyfrom
fix/esp32-native-console-default
Oct 22, 2026
Merged

zackees merged 2 commits into
feat/esp32-rmt4-async-legacyfrom
fix/esp32-native-console-default

Conversation

@zackees

@zackees zackees commented Oct 22, 2026

Copy link
Copy Markdown
Member

Summary

Stacked on #4885. Make every ESP32 console use native SDK transports; remove the Arduino-header availability dispatch that retained HardwareSerial, Stream and String in legacy addLeds builds.

  • Select one UART / hardware USB Serial-JTAG / native TinyUSB CDC backend at the preprocessor boundary and share console behavior.
  • Add the optional weak C application writer fastled_esp_console_write. Absent providers do not extract Arduino objects; applications already using Serial can explicitly route complete writes through it without FastLED including Arduino headers.
  • Submit each FastLED println body plus newline as one buffer. Native and Arduino UART complete writes share the SDK port TX mutex.
  • Fix native baud changes and cached-peek availability. Keep the console IRQ at level 1 so RMT level 3 remains available.
  • Repair native-first coexistence with Arduino 2.x before 2.0.17 through its small C UART HAL, gated by an address-only weak reference to an already linked vendor Serial object. No guessed class layout or method ABI.
  • Migrate USB board profiles to exclusive native ownership. Arduino HWCDC and TinyUSB automatic startup must be disabled globally. Native CDC advertises CDC only and rejects callbacks for other SDK-enabled classes, preventing those callback references from extracting Arduino USB/HAL/String.
  • Enforce the ESP Arduino-header / stream-header dependency policy in the existing Rust-backed bash lint, including inactive branches and availability probes. No GitHub Actions workflow added.

Matched Lolin D32 size

Same 96-pixel reporter, source SHA 5b4dae7b45d6a5c2f2e18e9c88d1b6b30d89770bc1dc2b512d32c7e01df9c0ed; espressif32 6.13.0, Arduino 2.0.17 / IDF 4.4.7.

Build Flash bytes Physical static RAM bytes
3.10.3 253,022 22,216
#4885 async RMT baseline 293,006 23,716
This native console change 289,446 23,476
Saving versus #4885 3,560 240

Native reporter has zero executable HardwareSerial, Arduino String, Stream::readString or ChannelManager functions. The entire regression versus 3.10.3 is not removed: +36,424 flash / +1,260 static RAM remain.

Verification

  • bash lint passes, including the existing Rust checker integration and focused checker tests.
  • Targeted Python dispatcher/transport and generated board-profile tests pass. Profile tests were first RED with the previous ownership settings.
  • Clean full native sanitizer suite passes 326/326 unit targets and 95/95 examples. Focused tests exercise real EspIO begin, peek/read/available and a 600-byte println in one write; RED then GREEN evidence covers the former errors. An initial run rejected old cached binary timestamps; the supported clean debug rebuild resolves it.
  • The previous dispatcher was tested in an isolated source copy: EspArduinoHeaderChecker flags both the Arduino.h probe and Arduino serial bridge. Copy removed; current production dispatcher lint passes.
  • Canonical AutoResearch on physical classic ESP32 (esp32dev_idf44, Arduino 2.0.3 / IDF 4.4.1) passes native RPC and three RMT loopback cases. Final canonical-image restoration passes RMT 4/4 checks and heap integrity.
  • Six concurrent Arduino/native UART output batches pass: 240 exact 192-byte records, both initialization orders, actual 57,600 baud transitions and 115,200 restoration. Every batch has intact heap before/after. Weak provider case has exactly 20 verified adapter calls.
  • SDK integration probes exercise serial_begin, write_bytes, println and flush through real EspIO. S3 IDF 4.4.7: 304,726 flash / 66,400 static RAM; P4 IDF 5.5.5: 375,584 / 72,624; S2 IDF 5.3.2: 293,695 / 32,860. All three native CDC maps exclude Arduino USB/USBMSC/TinyUSB HAL/USBCDC archive roots. Existing variant metadata provides USB identity without new VID/PID literals. These are separate integration probes, not matched D32 benchmarks. S3 map has no Arduino USB/HAL/HardwareSerial/String roots. P4 has no Arduino USB/HAL roots; core 3.3.11 main.cpp directly references Serial0.setPins, independently retaining HardwareSerial/String. No NO_GLOBAL_SERIAL flag is forced to hide this framework behavior.

Limits and migration

UART atomicity applies to complete submitted buffers. Separate Arduino Print calls and ROM writers bypassing the shared SDK mutex can still interleave.

USB validation here is SDK compilation and link-map inspection, not physical USB enumeration/reconnect evidence. Native CDC is CDC-only; composite classes and Arduino's software upload/reset handshake are not provided. BOOT/ROM recovery remains available. Existing USB startup flags must be disabled in the core build, not just in a sketch header; profiles now demonstrate the required settings. Optional writer hooks redirect output only; initialization/input remain native.

Platform-sensitive merge requires full CI and the relevant physical USB validation. Do not merge merely because UART HIL passes.

@zackees zackees added the ci-full Run the complete release-equivalent CI matrix on this PR SHA label Oct 22, 2026
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: FastLED/FastLED/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1fd8668b-240c-4b7b-8b4b-d2746994877b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Oct 22, 2026
@zackees
zackees merged commit 7d97b61 into feat/esp32-rmt4-async-legacy Oct 22, 2026
2 checks passed
zackees added a commit that referenced this pull request Oct 22, 2026
* fix: preserve strings on failed growth and reuse RPC response storage

* feat(esp32): enable autonomous slim RMT4 output by default

* fix(esp32): remove Arduino console retention with native SDK backends (#4887)

* fix(esp32): use native consoles without Arduino stream dependencies

* docs: record native ESP console validation and publication
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Oct 22, 2026
@zackees
zackees deleted the fix/esp32-native-console-default branch November 5, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run the complete release-equivalent CI matrix on this PR SHA

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant