Skip to content

fix(deploy): -bin (not just omit -hex) + \.\COM10 prefix for Windows (#927 follow-up) - #928

Merged
zackees merged 1 commit into
mainfrom
fix/927-followup-bin-and-com10-prefix
Jul 1, 2026
Merged

fix(deploy): -bin (not just omit -hex) + \.\COM10 prefix for Windows (#927 follow-up)#928
zackees merged 1 commit into
mainfrom
fix/927-followup-bin-and-com10-prefix

Conversation

@zackees

@zackees zackees commented Jul 1, 2026

Copy link
Copy Markdown
Member

Two follow-up bugs found by actually running the just-merged #923 deploy against the physically-attached LPC845-BRK on COM10. Both got past my previous PR's tests because they only surface when lpc21isp actually spawns.

Bug 1: -bin (not just omit -hex)

lpc21isp v1.97's DEFAULT file format is Intel HEX. My previous PR made the deployer omit -hex for .bin firmware, but that doesn't switch modes — it just keeps the default. The tool still tries to parse binary bytes as HEX ASCII and aborts:

File …/firmware.bin:
    loaded...
Missing start of record (':') wrong byte

The real switch is -bin. Pass it explicitly for non-.hex firmware.

Bug 2: Windows CreateFile("COM10") returns ERROR_FILE_NOT_FOUND

On Windows, lpc21isp opens the port via a bare CreateFile(<name>, …). Windows' DOS-device namespace requires the \.\ prefix for any COM name ≥ COM10; without it CreateFile returns ERROR_FILE_NOT_FOUND (2):

Can't open COM-Port COM10 ! - Error: 2

Add normalize_lpc21isp_port() which prefixes \.\ for COM10+ on Windows and is a no-op for COM1–COM9, already-prefixed paths, non-COM* names (Linux /dev/ttyUSB0 etc.), and every non-Windows host.

End-to-end verification

  • Direct lpc21isp spawn: lpc21isp -control -wipe -bin firmware.bin \.\COM10 115200 12000 reaches "Synchronizing (ESC to abort)..." — the ROM bootloader is now being polled at 115200 baud over the correct port.
  • Full daemon-driven fbuild deploy tests/platform/lpc845brk -e lpc845brk --port COM10 reaches the same sync phase and times out at 60 s because the board isn't in ISP mode. Entering ISP mode (hold SW3, tap SW4, release SW3) is a hardware step tracked by fbuild deploy: own nxplpc/LPC8xx flash end-to-end (FastLED is removing its direct pyocd path) #921 requirement 3 and is out of scope here.

Test plan

  • soldr cargo test -p fbuild-deploy --lib lpc::17/17 pass (added normalize_port_prefixes_com10_and_above_on_windows and normalize_port_is_a_noop_on_non_windows)
  • soldr cargo fmt --all -- --check — exit 0
  • soldr cargo clippy -p fbuild-deploy --all-targets -- -D warnings — exit 0
  • CI Check lanes should stay green.

Refs #921 (LPC845-BRK deploy end-to-end) and #927 (my prior incomplete fix).

🤖 Generated with Claude Code

Two follow-up bugs found by running the just-merged #923 deploy against
the physically-attached LPC845-BRK on COM10:

1. lpc21isp v1.97's DEFAULT is Intel HEX — omitting `-hex` doesn't
   switch to binary mode, it just keeps the default. Feeding a raw
   `.bin` still aborts with `Missing start of record (':') wrong byte`
   on the first non-`:` byte. The real switch is `-bin`. Pass that
   explicitly whenever the firmware path doesn't end in `.hex`.

2. On Windows, lpc21isp opens the port via `CreateFile(<name>, ...)`
   without prefixing. Windows' DOS-device namespace requires `\.\`
   for any COM name numbered COM10 or above; without it CreateFile
   returns `ERROR_FILE_NOT_FOUND (2)` and lpc21isp reports
   "Can't open COM-Port COM10 ! - Error: 2". Add
   `normalize_lpc21isp_port()` which prefixes `\.\` for COM10+ on
   Windows and is a no-op for COM1–COM9, already-prefixed paths, non-
   `COM*` names (e.g. Linux `/dev/ttyUSB0`), and every non-Windows
   host.

Verified end-to-end against the LPC845-BRK on COM10:

- Direct spawn (`lpc21isp -control -wipe -bin firmware.bin \.\COM10
  115200 12000`) now reaches "Synchronizing (ESC to abort)..." — the
  board's ROM bootloader is now being polled at 115200 baud over the
  correct port.
- Full daemon-driven `fbuild deploy tests/platform/lpc845brk -e
  lpc845brk --port COM10` reaches the same sync phase and times out
  after 60 s because the board is not in ISP mode. Entering ISP mode
  (hold SW3, tap SW4, release SW3) is a hardware step tracked by
  #921 requirement 3 and is out of scope here.

Test additions (17/17 pass via real ~/.local/bin/soldr.exe):
- `normalize_port_prefixes_com10_and_above_on_windows` (Windows-only)
- `normalize_port_is_a_noop_on_non_windows` (POSIX-only)
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@zackees, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 6 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 563301a7-abe4-47d7-940a-21dffa51b84d

📥 Commits

Reviewing files that changed from the base of the PR and between 5989187 and 0a6de44.

📒 Files selected for processing (1)
  • crates/fbuild-deploy/src/lpc.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/927-followup-bin-and-com10-prefix

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.

@zackees
zackees merged commit 3d9a6cb into main Jul 1, 2026
93 checks passed
@zackees
zackees deleted the fix/927-followup-bin-and-com10-prefix branch July 1, 2026 21:56
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant