Skip to content

chore(lpc): pick up LPC8xx core IOCON pinMode + HardFault frame fixes - #5264

Merged
zackees merged 1 commit into
masterfrom
chore/lpc8xx-core-iocon-hardfault
Nov 18, 2026
Merged

zackees merged 1 commit into
masterfrom
chore/lpc8xx-core-iocon-hardfault

Conversation

@zackees

@zackees zackees commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Cascades the LPC8xx Arduino core fixes into FastLED builds.

repo PR merge SHA
FastLED/framework-arduino-lpc8xx #42 (fixes #40, #41) 547b5a7053f60c59bbd86e9c6796bebae07c8241
FastLED/platform-nxp-lpc8xx #12 (pins the framework at 547b5a7) 4804de671a3a43e204b0b742b8984380c5a1fe2b

Depends on FastLED/framework-arduino-lpc8xx#42 and FastLED/platform-nxp-lpc8xx#12. Both are merged.

  • ci/boards.py: _NXPLPC_PLATFORM 4b6d395 -> 4804de6. Every LPC board also gets platform_packages = framework-arduino-lpc8xx@.../archive/547b5a7….tar.gz#547b5a7…. fbuild ignores a git platform's platform.json package pins and uses its compiled-in core (9e8be02; the fbuild cache held only that one). Without the override the platform bump would not reach the build. The generated .build/fbuild/lpc845/platformio.ini now carries the override.
  • AutoResearchLowMemory.h: corePullCheck [a,b,c,d] (LPC845, non-DMA-loopback builds; +784 B flash, AutoResearch 63988/65536). FastLED's backend sets the opposite pull, then the core's ::pinMode(INPUT_PULLUP / INPUT_PULLDOWN) runs and the pin is read. --pin-toggle-rx calls it on pins the jumper scan finds idle and fails on a wrong reading (ci/autoresearch/lpc_pin_scan.py::check_core_pulls, with unit tests).
  • phases.py: pre-existing bug. The nxplpc re-flash looked for .fbuild/build/<env>/release/firmware.bin, but current fbuild writes .fbuild/build/release/, so --test-fault-emit always failed before its second trigger. It now accepts both.
  • Docs/comments: the cascade step (register-maps.md), the fault-emit PC check (hardware-autoresearch.md), and the watchdog NMI comment (new FAULT format, weak alias, NO_FAULT_EMIT interaction).

Hardware evidence (LPC845-BRK, /dev/ttyACM1)

#40 core pinMode pulls, idle pins from findConnectedPins:

  • old core 9e8be02: P0_0/9/17/21 -> up=0;down=1 (pull landed on another pad)
  • new core: P0_0/9/17/21 -> up=1,down=0. In the final --pin-toggle-rx run: core pull check PASS: 0:up=1,down=0 1:up=1,down=0 6:up=1,down=0 8:up=1,down=0

#41 fault frame, bash autoresearch lpc845 --test-fault-emit:

  • old: FAULT: HardFault PC=0x10001E70 LR=0xFFFFFFF9 xPSR=0x10000020 (PC in RAM, LR is an EXC_RETURN value)
  • new: trigger_oom PC=0x0000039E LR=0x000005F5 xPSR=0x41000000 EXC_RETURN=0xFFFFFFF9; trigger_stackblow PC=0x0000039E LR=0x00000615 xPSR=0x61000000 EXC_RETURN=0xFFFFFFF9. Both PASS.
  • objdump: 0x39e: udf #255 in triggerLowMemoryNullFault; LR = return addresses after bl 39a at 0x5f0 (trigger_oom invoker) and 0x610 (recurseLowMemoryStackBlow).

Regression, bash autoresearch lpc845 --pin-toggle-rx (scan picks TX=P0_13 RX=P0_10): 3/3 PASS on the old and the final build (1 kHz mean 1000028 ns, 5 kHz 200059 ns, 10 kHz 100067 ns; 64 edges each).

Compiles: bash compile lpc845 --examples Blink (13968 B), bash compile lpc804 --examples Blink (6856 B), bash compile lpc845 --examples AutoResearch (63988 B). All succeed. bash lint passes; ci/tests/test_lpc_pin_scan.py 11 passed.

Not done here

  • Root platformio.ini LPC envs still pin platform 12265f7. bash compile/autoresearch synthesize their own ini, so those envs are unused.
  • fbuild's compiled-in default core is still 9e8be02. Bumping it is an fbuild change.

Summary by CodeRabbit

  • Improvements
    • Improved LPC board pin-pull validation and firmware deployment across supported build layouts.
    • Updated LPC board configurations to use a consistent, pinned platform and framework combination.
  • Documentation
    • Clarified LPC pin-check behavior, fault diagnostic fields, and how to verify reported fault addresses.
    • Added guidance for keeping platform and framework versions aligned and locating the framework used for a build.

Cascade FastLED/framework-arduino-lpc8xx#42 (fixes #40, #41) into FastLED
builds:

- ci/boards.py: platform-nxp-lpc8xx 4b6d395 -> 4804de6 (#12, pins the
  framework at 547b5a7), and pin framework-arduino-lpc8xx 547b5a7 through
  platform_packages on every LPC board. fbuild does not read a git
  platform's platform.json package pins, so without the override the build
  stayed on fbuild's compiled-in core (9e8be02).
- AutoResearch: corePullCheck RPC (LPC845, non-DMA-loopback builds) checks
  the vendor core's ::pinMode pulls, and --pin-toggle-rx runs it on pins
  the jumper scan finds idle.
- autoresearch: the nxplpc re-flash step looked for firmware.bin under
  .fbuild/build/<env>/release/, but current fbuild writes
  .fbuild/build/release/. The second --test-fault-emit trigger always
  failed on that. Both layouts are now accepted.
- Docs/comments: the cascade step, the new FAULT line format, the
  NO_FAULT_EMIT interaction, and a weak (not strong) NMI alias.
@zackees
zackees enabled auto-merge November 18, 2026 05:14
@github-actions github-actions Bot added the sanitized Title, body and conversation screened; review text requires separate screening. label Nov 18, 2026
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The LPC boards now use a pinned framework package. AutoResearch checks core pull behavior on idle pins and includes the result in the pin-toggle test status. The build checks two firmware locations, and LPC fault diagnostic documentation has been updated.

Changes: LPC core pull verification

Layer / File(s) Summary
Framework pin and build resolution
ci/boards.py, ci/autoresearch/phases.py, agents/docs/register-maps.md
LPC board configurations now pin the framework package. The build checks both release paths for firmware.bin, and the guide describes the commit settings and cache paths to inspect.
Idle-pin selection and core pull check
ci/autoresearch/lpc_pin_scan.py, examples/AutoResearch/AutoResearchLowMemory.h, ci/tests/test_lpc_pin_scan.py
The scan selects unoccupied pins and checks up to four through corePullCheck. The LPC845 helper returns skipped-pin results or pull readings. Tests cover pin selection and core pull responses.
Pin-toggle runner and instructions
ci/autoresearch/test_lpc_pin_toggle_rx.py, agents/docs/hardware-autoresearch.md
The pin-toggle test now includes the core pull check in its exit status. The hardware guide describes the check on idle pins.

LPC fault diagnostics

Layer / File(s) Summary
Fault diagnostic documentation
src/platforms/arm/lpc/watchdog_lpc.impl.hpp, agents/docs/hardware-autoresearch.md
The watchdog comments now describe the NMI handler as a weak alias and document the FAULT: NMI line and disabled-emission behavior. The hardware guide documents FAULT: HardFault fields and how to check the reported PC against the built ELF.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant PinToggleRx
  participant PinScan
  participant LPC845CorePullCheck
  participant LPC845PullHelper
  PinToggleRx->>PinScan: Select idle pins and check core pulls
  PinScan->>LPC845CorePullCheck: Send up to four pin arguments
  LPC845CorePullCheck->>LPC845PullHelper: Check each nonnegative pin
  LPC845PullHelper-->>LPC845CorePullCheck: Return skip or up/down readings
  LPC845CorePullCheck-->>PinScan: Return combined readings
  PinScan-->>PinToggleRx: Return pass, fail, or unavailable
Loading

Possibly related PRs

  • FastLED/FastLED#5262: Adds the LPC jumper scan and bench behavior that this change uses to select idle pins for core pull checks.
Merge Risk: Moderate · up to 5a00c

This PR pins the LPC8xx framework package and adds a core pull-behavior check to the AutoResearch pin-toggle test. The new check puts LPC845-specific code in the platform-neutral AutoResearch example without the required exception marker or a neutral API. Production firmware behavior is not affected, but this should be fixed or explicitly marked before merging.

- [ ] 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

@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 18, 2026
@zackees
zackees added this pull request to the merge queue Nov 18, 2026
@github-actions github-actions Bot added sanitized Title, body and conversation screened; review text requires separate screening. and removed sanitized Title, body and conversation screened; review text requires separate screening. labels Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Memory usage (this PR vs. its merge base)

Change in examples/Blink per target. The left number is this PR's image flash / attributed RAM in bytes; the colored delta is the change from the merge base (red ↑ is larger, green ↓ is smaller, Same is unchanged).

Target FLASH [bytes] RAM [bytes]
attiny85 2,460 (Same) 136 (Same)

@github-actions github-actions Bot added sanitized Title, body and conversation screened; review text requires separate screening. and removed sanitized Title, body and conversation screened; review text requires separate screening. labels Nov 18, 2026
Merged via the queue into master with commit 505cd2f Nov 18, 2026
132 of 133 checks passed
@zackees
zackees deleted the chore/lpc8xx-core-iocon-hardfault branch November 18, 2026 05:21
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Nov 18, 2026
@github-actions github-actions Bot added sanitized Title, body and conversation screened; review text requires separate screening. and removed sanitized Title, body and conversation screened; review text requires separate screening. labels Nov 18, 2026
@zackees

zackees commented Nov 18, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Action not completed

Pull request is closed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions github-actions Bot added sanitized Title, body and conversation screened; review text requires separate screening. and removed sanitized Title, body and conversation screened; review text requires separate screening. labels Nov 18, 2026
sutaburosu pushed a commit to sutaburosu/FastLED that referenced this pull request Nov 18, 2026
…d; skip IOCON-identity pins (FastLED#5274)

* fix(autoresearch): LPC corePullCheck only in the --pin-toggle-rx build; skip IOCON-identity pins (FastLED#5270)

- phases.py passes FASTLED_AUTORESEARCH_LPC_CORE_PULL_CHECK with
  --pin-toggle-rx; the sketch compiles corePullCheck only under it. The
  default lpc845 image drops from 60472 to 59684 bytes.
- Platform-neutrality markers on the remaining LPC lines from FastLED#5262/FastLED#5264.
- The pull check skips P0_4 and P0_24 (IOCON slot == GPIO bit, so they
  cannot detect framework-arduino-lpc8xx#40), and a missing binding in
  the --pin-toggle-rx build now fails instead of skipping.

Refs FastLED#5268

* fix: address CodeRabbit review feedback

- check_core_pulls probes the corePullCheck binding (four -1 slots) before
  scanning, so a missing RPC fails even when no idle pin qualifies or the
  scan fails
- test_lpc_pin_toggle_rx documents that it requires the --pin-toggle-rx build
- lowMemCorePullCheck reads back via lowMemSettledHigh (fl::digitalRead);
  only the vendor ::pinMode calls under test stay platform specific

* fix(autoresearch): an unanswered corePullCheck probe fails instead of skipping
sutaburosu pushed a commit to sutaburosu/FastLED that referenced this pull request Nov 19, 2026
…ly the handshake timeout (FastLED#5293)

* ci(fbuild): require fbuild 2.5.52, drop the LPC8xx core pin, retry only the handshake timeout

fbuild 2.5.52 builds the LPC8xx core at 547b5a7 itself (FastLED/fbuild#2078),
so ci/boards.py no longer needs the framework-arduino-lpc8xx platform_packages
override on the five LPC boards.

2.5.52 also fixes the 'session closed' serial attach of FastLED#5271
(FastLED/fbuild#2083, FastLED#2084, FastLED#2089): the client now reports the daemon's
reason, so the retry's 'session closed' match was dead. What remains on a
CPU-starved host is the client's 5 s handshake timeout (FastLED/fbuild#2095):
0 of 133 attaches failed at this host's own load (18-97), 11 of 16 at load
73-106 and 54 of 56 at 106-148 with CPU hogs added. NativeFbuildSerialAdapter
now retries that timeout once without restarting the daemon, and a lost daemon
still gets its own single restart.

Also silence an unused-variable warning in SlimBridgeController on targets
where FL_WARN_EVERY compiles out (seen in the lpc845 Blink build).

Refs FastLED#5268, FastLED#5271, FastLED#5264

* fix: address CodeRabbit review feedback

- Attach the retried handshake-timeout note to the error when the
  lost-daemon restart (ensure_fbuild_daemon) itself raises, so RpcBench
  still reports the first attempt; regression test added.

* ci(serial): mark the daemon-restart try as KBI-handled by connect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanitized Title, body and conversation screened; review text requires separate screening.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

not compatible with teensy 3.1

1 participant