fix(deploy): -bin (not just omit -hex) + \.\COM10 prefix for Windows (#927 follow-up) - #928
Conversation
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)
|
Warning Review limit reached
Next review available in: 6 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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
-hexfor.binfirmware, but that doesn't switch modes — it just keeps the default. The tool still tries to parse binary bytes as HEX ASCII and aborts:The real switch is
-bin. Pass it explicitly for non-.hexfirmware.Bug 2: Windows
CreateFile("COM10")returns ERROR_FILE_NOT_FOUNDOn 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 returnsERROR_FILE_NOT_FOUND (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/ttyUSB0etc.), and every non-Windows host.End-to-end verification
lpc21isp -control -wipe -bin firmware.bin \.\COM10 115200 12000reaches "Synchronizing (ESC to abort)..." — the ROM bootloader is now being polled at 115200 baud over the correct port.fbuild deploy tests/platform/lpc845brk -e lpc845brk --port COM10reaches 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 (addednormalize_port_prefixes_com10_and_above_on_windowsandnormalize_port_is_a_noop_on_non_windows)soldr cargo fmt --all -- --check— exit 0soldr cargo clippy -p fbuild-deploy --all-targets -- -D warnings— exit 0Refs #921 (LPC845-BRK deploy end-to-end) and #927 (my prior incomplete fix).
🤖 Generated with Claude Code