Skip to content

fix(platforms/lpc): work around Serial.println silent-drop on LPC8xx (closes #3313) - #3314

Merged
zackees merged 1 commit into
masterfrom
fix/3313-lpc-println-binding
Jun 20, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/3313-lpc-println-binding

Conversation

@zackees

@zackees zackees commented Jun 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Empirical bug: Serial.println(s) on LPC845-BRK with the Arduino core silently drops every byte. But Serial.print(s) works fine, and Serial.print(\"\r\n\") works fine. So fl::println -- which routes through platforms::println -> Serial.println -- is invisible on the wire, making every fl::println / FL_WARN_LIT / FL_LOG_LIT call site silent on LPC.

That blocked the #3300 LPC845-BRK bring-up echo investigation: every diagnostic trace marker I added to setup() and the dispatcher was compiled in correctly (verified via arm-none-eabi-strings firmware.elf) but never reached the host serial monitor.

Closes #3313.

Workaround

Split platforms::println into two Serial.print calls. Same byte-write path that FL_DBG_F's log_emit_f uses successfully (fl::printf -> fl::print -> platforms::print).

```diff
void println(const char* str) FL_NO_EXCEPT {
if (!Serial) return;

  • Serial.println(str);
  • Serial.print(str);
  • Serial.print("\r\n");
    }
    ```

Root cause is in Print::println's path in the Arduino core (filed separately for upstream investigation). Until the Arduino-core fix lands, FastLED's platforms::println shim is the right place to prevent every LPC user from hitting silent diagnostics.

Verification

  • ✅ `bash test --cpp` -- 333/333 pass (host unaffected).
  • ✅ `bash compile lpc845brk --examples AutoResearch` -- builds cleanly.

Test plan

  • Host unit tests green.
  • LPC845 compile green.
  • CI matrix green (this PR).

Refs

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed serial output handling on LPC-based microcontroller platforms to resolve communication issues with USB-VCOM interfaces.

…loses #3313)

Empirical bug on LPC845-BRK with the Arduino core: Serial.println(s)
silently drops every byte -- the host's USB-VCOM bridge never sees the
output. But Serial.print(s) works fine, and Serial.print("\r\n") works
fine. So fl::println on LPC -- which routes through
platforms::println -> Serial.println -- is invisible on the wire,
making every fl::println / FL_WARN_LIT / FL_LOG_LIT call site silent.

That's not just cosmetic: every diagnostic trace marker in the
AutoResearch LowMemory bring-up is gone, which is what blocked
investigation of #3300 (LPC845-BRK bring-up echo silence).

Workaround: split platforms::println into two Serial.print calls. This
is the same byte-write path that FL_DBG_F's log_emit_f uses successfully
(via fl::printf -> fl::print -> platforms::print). Confirmed reaching
the host on every test build.

Root cause is in Print::println's path in the Arduino core (filed
separately at #3313 for upstream investigation). Until the Arduino-core
fix lands, FastLED's platforms::println shim is the right place to
prevent every LPC user from hitting silent diagnostics.

Verification:
- bash test --cpp -- 333/333 pass.
- bash compile lpc845brk --examples AutoResearch -- builds cleanly.

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

coderabbitai Bot commented Jun 20, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c2fb7d62-1a00-4f1a-b8d5-f6973c945178

📥 Commits

Reviewing files that changed from the base of the PR and between 837b974 and bcd87a5.

📒 Files selected for processing (1)
  • src/platforms/arm/lpc/io_lpc.cpp.hpp

📝 Walkthrough

Walkthrough

In src/platforms/arm/lpc/io_lpc.cpp.hpp, the platforms::println(const char*) function replaces a single Serial.println(str) call with two sequential calls — Serial.print(str) and Serial.print("\r\n") — along with inline comments documenting the LPC8xx USB-VCOM drop behavior that motivated the change.

Changes

LPC println two-write workaround

Layer / File(s) Summary
LPC println two-write fix
src/platforms/arm/lpc/io_lpc.cpp.hpp
println(const char*) splits Serial.println(str) into Serial.print(str) + Serial.print("\r\n"), with inline comments referencing FastLED #3313 and the LPC8xx USB-VCOM silent-drop behavior.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • FastLED/FastLED#2579: Modifies the same platforms::println(const char*) API surface for a different platform (Renesas RA io_renesas.cpp.hpp), directly parallel to this LPC change.
  • FastLED/FastLED#2997: Adds the original Arduino-backed Serial I/O layer for LPC in src/platforms/arm/lpc/io_lpc.cpp.hpp, including the println that this PR now patches.
  • FastLED/FastLED#3014: Introduces FL_WARN_LIT macros that route through fl::println, the exact call chain this fix unblocks on LPC8xx.

Poem

🐇 Two prints are better than one, it seems,
On LPC8xx where println silently dreams.
A \r\n split, a workaround neat,
The serial bus hums — the bytes finally meet.
Hop hop, bug squashed! The trace lines appear! 🎉

✨ 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/3313-lpc-println-binding

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.

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.

[BUG-LPC] Serial.println / fl::println silent on LPC845-BRK -- Serial.print works fine (blocks #3300)

1 participant