Skip to content

[#3300 bisect] Find the commit that broke LPC845-BRK JSON-RPC echo — bisect Arduino-core LPC8xx #3325

Closed

Description

@zackees

Goal

Find the commit (in FastLED, fbuild, or zackees/ArduinoCore-LPC8xx) that broke LPC845-BRK JSON-RPC echo, by bisection.

What we know

Last known-working baseline: 2026-06-13 ~17:40 PT -- FastLED commit 0968d55f28 (feat(autoresearch): wire LPC845-BRK bring-up harness into bash autoresearch). Its body claims direct verification:

"the three hardware capabilities (Serial.println, FastLED log pipeline, JSON-RPC echo) all work in isolation on the device -- proven by the JSON-RPC round-trip TX params:[4242] -> RX result:4242 plus FL_DBG emission src/fl/remote/remote.cpp.hpp(151): Stored request ID for echo reaching COM10"

Current broken state: 2026-06-19 / 20 -- direct PowerShell [System.IO.Ports.SerialPort]::Open('COM20') returns 0 bytes in 6 seconds after a clean pyocd reset. The device transmits nothing.

Investigation plan

Phase 1: Confirm FastLED-side refactors did not regress the RPC dispatch path

Test ESP32-C6 (board already attached on COM9):

```bash
bash autoresearch esp32c6
```

Phase 2: Bisect the LPC Arduino-core

The framework is referenced by URL only (no pinned commit) in zackees/platform-nxplpc-arduino's platform.json:

```json
"framework-arduino-lpc8xx": {
"type": "framework",
"optional": true,
"version": "https://github.com/zackees/ArduinoCore-LPC8xx.git"
}
```

So whatever commit was on the default branch at fetch time is what got cached. The currently-cached commit is 195a2eddd31eba8472ceaffa6a1a1902f72439ae (from ~/.fbuild/prod/cache/platforms/zackees-ArduinoCore-LPC8xx/2cdca7de542bef71/0.1.0+g195a2ed/).

To bisect, add a platform_packages override to [env:lpc845brk] in platformio.ini:

```ini
platform_packages =
framework-arduino-lpc8xx@https://github.com/zackees/ArduinoCore-LPC8xx.git#
```

Sanity check that bisection works: fbuild's cache key uses <commit-sha> -- a fresh path under ~/.fbuild/prod/cache/platforms/zackees-ArduinoCore-LPC8xx/<hash>/<version>+g<short-sha>/ must appear on each bisect step. If fbuild reuses the OLD cached subdir despite a new commit pin, the bisect produces false results.

```bash

Before each bisect step:

ls ~/.fbuild/prod/cache/platforms/zackees-ArduinoCore-LPC8xx/

Should show a new dir per commit. If not, file a follow-up bug against fbuild.

```

Arduino-core LPC8xx commits since the working baseline (descending by datestamp)

Commit Date (UTC) Title Bisect bucket
da8f2b8b42bed0d89f5e3f9d680a1832b5b4fa98 2026-06-20 00:37 fix(startup): override HardFault_Handler with sync-emit + reboot (#31) This session; safe -- only fault handler
195a2eddd31eba8472ceaffa6a1a1902f72439ae 2026-06-13 22:23 perf(linker): pack libgcc __aeabi_fdiv into pre-CRP gap (0xC0..0x2FC) (#29) HIGHEST SUSPICION -- linker-script change touching CRP region
867089d10c14994d1748a7eaba6731542cbb8201 2026-06-13 22:07 fix(linker): discard .ARM.exidx -- M0+ does not unwind (#28) High -- linker section change
ec72e00584b30a124aae3022894ece4e8b9d6dc8 2026-06-13 21:57 perf(Wire,SPI): convert globals to trivial proxy + function-local-static impl (#27) High -- static-init order change
c9cbc054d2ddf675a9c1806ce20e08d3fa215e36 2026-06-13 21:26 perf(lpc8xx): collapse operator delete variants to a single free thunk (#26) Low
77b20dfc9bf247cb9669e5d288aae298859b6d05 2026-06-13 21:22 fix(lpc8xx): drop unsigned long operator new overloads (32-bit ABI) (#25) Low
33212f005889effb63ceb491d3ff234e1b9a728e 2026-06-13 21:17 fix(lpc845): complete bring-up gaps (operator new, .ARM.exidx, heap base, F_CPU) (#24) HIGH -- touches F_CPU; could mis-set USART BRG
3ec71c5498c21d17033cc8c4a48daf84e4b2733b 2026-06-13 14:53 Merge pull request #22 from zackees/fix/lpc845-serial-clock-pins --
4560e6c41dd2c49e8b27aeed77d3abc5098eb488 2026-06-13 14:49 fix(lpc845): correct SYSCON map, USART0 func clock, FRO_DIRECT, VCOM pins Baseline (working)
a00864bbce48194b9c8d0b81d9f7ce5d5a48abc6 2026-06-12 18:37 Builds and runs without hardfault (#20) Baseline (working)

Bisect order (binary search the 7 commits between #24 inclusive and HEAD)

Mid-point first. Commits in window: #24, #25, #26, #27, #28, #29, #31 (linear).

  1. Pin to Tweak "yellow" (and "aqua") HSV colors #27 (ec72e00584) -- midpoint.
  2. Continue binary-narrowing per result.
  3. When narrowed to a single commit -> revert in a fresh Arduino-core PR, re-test, file fix on the LPC side.

Top-3 priors (if budget runs out before binary search completes)

  1. FastLED with avr/sleep.h #29 195a2eddd3 (pre-CRP linker pack) -- riskiest; revert this first.
  2. Tweak "yellow" (and "aqua") HSV colors #27 ec72e00584 (Wire/SPI globals -> function-local-static) -- changes static-init order; could leave Serial un-initialized when bring-up references it.
  3. SAM D20 Support #28 867089d10c (discard .ARM.exidx) -- if any LPC8xx code accidentally references the discarded section, link order shifts and the vector table or HardFault handler could end up at the wrong address.

Refs

Filed from /clud-fix session continuing #3208 meta. ESP32-C6 sanity check + bisection in flight.

Activity

  1. zackees commented on Jun 20, 2026

    @zackees
    MemberAuthor

    Update — bisection axis is wrong; real bug is FastLED-side and platform-agnostic

    After running the PIO-side bisection on this branch (bisect/3325-aclpc), the findings invalidate this issue's framing. The ArduinoCore-LPC8xx commit window is not the regression axis. Documenting here so the next person doesn't repeat the work.

    What the bisection actually showed

    Pinned framework-arduino-lpc8xx to two endpoints of the suspect window, via platform_packages in both ci/boards.py (for bash compile) and root platformio.ini (for bash autoresearch):

    ACLPC pin FastLED Device response
    4560e6c41d (baseline, "working" per this issue's table) master 5d18212873 Method not found: echo ❌
    da8f2b8b42 (HEAD = #31) master 5d18212873 Method not found: echo ❌

    Both endpoints fail identically. No commit in the ACLPC window is the variable.

    Why we previously thought the device was silent

    The "0 bytes in 6 seconds after a clean pyocd reset" in the original report was a PowerShell [System.IO.Ports.SerialPort]::Open() methodology bug. The LPC11U35 USB-VCOM bridge requires DtrEnable=true + RtsEnable=true to gate data through. Without those properties set, the host sees zero bytes even though the LPC845 is transmitting normally. bash autoresearch (via ci/util/serial_interface.py:_pyserial_dtr_reset) sets these correctly — only the ad-hoc probes were broken.

    With DTR/RTS enabled the LPC845-BRK has been responding the whole time. Sample output from the baseline ACLPC pin:

    src/fl/remote/remote.cpp.hpp(151): INFO: Stored request ID for echo (id=1)
    src/fl/remote/rpc/rpc.cpp.hpp(102): WARN: RPC: Method not found: echo
    REMOTE: {"id":1,"error":{"code":-32601,"message":"Method not found: echo"},"jsonrpc":"2.0"}
    RESULT: {"type":"status","ready":true,"uptimeMs":147793949}
    

    This is the same error envelope ESP32-C6 returns. Both platforms exhibit the bug identically.

    Where the bug actually lives

    • autoResearchLowMemorySetup() (examples/AutoResearch/AutoResearchLowMemory.h:158) calls remote.bind("echo", lambda).
    • Dispatch (src/fl/remote/rpc/rpc.cpp.hpp:118-122) calls mRegistry.find(methodName) and misses.
    • mRegistry is fl::unordered_map<fl::string, RpcEntry> — a real hash map, not fixed-capacity. The bind path looks structurally correct on source review. Reason for the runtime miss is not yet isolated.

    Top FastLED-side suspects (in git log 0968d55f28..master against src/fl/remote/):

    1. 581bb2a202 — perf(rpc): non-template RuntimeRpcBinding dispatch on low-memory targets (#3246 / #3258) — straight revert blocked by downstream commits modifying runtime_rpc_binding.{h,cpp.hpp}.
    2. 1aa1e6a345 — refactor(rpc): rename envelope markers __async/__skip → ackOnly/noEnqueue (#3228).
    3. e18aa2bbdf — perf(rpc): gate rpc.discover + revert SBO bump to fix LowMemory build regression (#3081).
    4. da59e86e24 — Migrate logging macros to printf style (#3190).

    Bonus bug en passant — LPC845-BRK runs in LARGE_MEMORY mode

    ~/.platformio/packages/framework-arduino-lpc8xx/variants/lpc845brk/variant.h only defines VARIANT_BOARD_LPC845BRK 1. It does not define LPC845 / __LPC845__ / LPC845M301, which is what src/platforms/arm/lpc/is_lpc.h:28-30 keys FL_IS_ARM_LPC_845 off of. Detection silently fails → FL_IS_ARM_LPC undefined → FL_PLATFORM_HAS_LARGE_MEMORY = 1 on a 16KB-SRAM part. The TypedInvoker path (~2.1 KB/sig) is active instead of the RuntimeRpcBinding path. Tracking separately — likely fixed upstream in zackees/ArduinoCore-LPC8xx's variant headers.

    This means LPC has been running the LARGE_MEMORY code path (same as ESP32-C6) which is consistent with both platforms showing the identical error.

    Recommended next steps

    1. Re-scope this issue or close it as a false-trail. The Arduino-core bisection table is no longer load-bearing.
    2. New issue: "Remote::bind registration not visible to Rpc::handle dispatch — both LARGE_MEMORY platforms (LPC, ESP32-C6) fail identical." I'll add a host unit test (tests/fl/remote/test_echo_bind_dispatch.cpp) that mirrors the AutoResearch bind+dispatch path — if it fails on host, we have a fast reproducer.
    3. Separate Arduino-core PR to add LPC845M301 (or equivalent canonical macro) to variants/lpc845brk/variant.h, restoring FL_IS_ARM_LPC_845 → LowMemory mode → ~2 KB flash savings.

    Branch bisect/3325-aclpc has the diagnostic edits reverted; it can be deleted once this comment is acknowledged.

    cc'ing for awareness in case anyone is mid-bisect on the ACLPC axis — please pause and read this thread first.

  2. moved this from Triage to Done in FastLED Trackeron Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions