Repository navigation
Closed
Description
Context
esp_rom_printf is already discouraged by FastLED's C++ lint checker: it bypasses FastLED logging, blocks on a slow peripheral, and spreads platform-specific output into code that should use FastLED's logging/IO layer. The current source still has suppressed runtime call sites.
Current scan:
rg -n esp_rom_printf\( examples/AutoResearch src/platforms/esp -g *.h -g *.hpp -g *.cpp
The runtime call sites are grouped in:
examples/AutoResearch/AutoResearchWave8Expand.handexamples/AutoResearch/AutoResearchParlioEncode.h: boot-time benchmark output originally routed through ROM printf so AutoResearch output could reach USB-Serial-JTAG.src/platforms/esp/32/drivers/usb_serial_jtag_esp32_idf.hppandsrc/platforms/esp/32/detail/io_esp_jtag_or_uart.hpp: USB-Serial-JTAG bootstrap/fallback diagnostics.src/platforms/esp/32/drivers/lcd_spi/lcd_spi_peripheral_esp.cpp.hpp: LCD SPI/clockless error diagnostics from IRAM-sensitive paths.
The lint/checker references and tests should remain; this issue is about eliminating runtime source calls rather than removing the checker.
Proposal
Replace direct runtime esp_rom_printf usage with appropriate FastLED-owned mechanisms:
- Route AutoResearch benchmark output through
FL_PRINT,fl::print, or an AutoResearch serial helper once USB-Serial-JTAG routing is reliable. - Replace USB-Serial-JTAG bootstrap logs with a FastLED-owned platform output abstraction, or make the initialization path report state after the normal logging sink is available.
- For IRAM/error paths such as LCD SPI, record error state/counters in the ISR/IRAM path and emit logs from task/poll context instead of printing directly from the low-level transmit path.
- Remove
// ok esp_rom_printfsuppressions from runtime source files as each call site is replaced.
Acceptance criteria
rg -n esp_rom_printf\( examples/AutoResearch src/platforms/esp -g *.h -g *.hpp -g *.cppfinds no runtime source call sites.esp_rom_printfremains allowed only in lint/checker code, tests that verify the checker, or documentation that explains the ban.- AutoResearch benchmark output remains visible to the host on supported ESP32 USB-Serial-JTAG boards.
- USB-Serial-JTAG bootstrap/fallback diagnostics are still available through FastLED-owned logging/IO or through explicit non-runtime state reporting.
- LCD SPI/clockless failure paths do not log from ISR/IRAM-sensitive code; failures are surfaced from task-safe context.
- The existing
EspRomPrintfCheckercontinues to reject new rawesp_rom_printfruntime calls.
Open questions
- Should a very early ESP32 bootstrap path have a dedicated FastLED emergency sink, or should bootstrap diagnostics be deferred until normal logging is initialized?
- Should the lint checker become stricter by disallowing
// ok esp_rom_printfsuppressions in runtime source after this cleanup lands?
Related issues
- perf(autoresearch): use FL_PRINT instead of esp_rom_printf in on-device benchmarks #2540 tracks the narrower AutoResearch benchmark cleanup.
- fl::print: minimal-surface contract — non-blocking on missing CDC host, USJ LL fallback on ESP32 USJ chips #2668 captured the broader
fl::print/USB-Serial-JTAG output contract and explicitly called out avoidingesp_rom_printfin favor of FastLED-owned IO.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
chore(esp32): eliminate runtime esp_rom_printf call sites (#2751)