Repository navigation
feat(autoresearch): accept LPC-Link2 CMSIS-DAP VID:PID for LPC845-BRK - #3494
Merged
Merged
Conversation
Newer LPC845-BRK / LPCXpresso boards ship with NXP's LPC-Link2 CMSIS-DAP
firmware pre-flashed on the on-board debug probe. That firmware presents
the LPC845's USART0 as a virtual COM port alongside the CMSIS-DAP HID
interface at VID:PID 1FC9:0132 — NXP's own USB VID, not the community
"V-USB" pool used by the older LPCXpresso VCOM firmware (16C0:0483).
`ci/util/port_utils.py::ENVIRONMENT_TO_VCOM_VID_PID` only knew about
16C0:0483, so `bash autoresearch lpc845brk` failed at port detection on
any board with the newer firmware:
No USB serial port matched expected VCOM fingerprint for 'lpc845brk'
(VID:PID 16C0:0483). Detected USB ports: COM10=1FC9:0132, ...
Change the map from single-VID:PID to tuple-of-VID:PIDs so an env can
accept any of several firmware variants. All four LPC8xx canary board
envs (lpc845brk, lpc845, lpc804, lpcxpresso845max, lpcxpresso804) now
accept both fingerprints; the first port matching ANY listed pair wins.
## Backwards compatibility
Renamed the map to `ENVIRONMENT_TO_VCOM_VID_PIDS` (plural). A shim
`ENVIRONMENT_TO_VCOM_VID_PID` derived from the first entry of each list
is exported for any external caller that still reads the singular name;
deprecated and slated for removal once no in-repo callers remain.
Error message now lists BOTH accepted fingerprints when neither is
found, so users on Windows can immediately see which firmware the
scanner is looking for:
No USB serial port matched expected VCOM fingerprint for 'lpc845brk'
(VID:PID 16C0:0483 or 1FC9:0132). Detected USB ports: ...
## Tests
Added three test cases to `TestAutoDetectUploadPort` covering:
- Match on the primary (LPCXpresso) 16C0:0483 fingerprint.
- Match on the LPC-Link2 CMSIS-DAP 1FC9:0132 fingerprint.
- Error message mentions BOTH VID:PIDs when neither matches.
Also fixed a pre-existing stale assertion in the same test class:
`test_expected_environment_probe_failure_falls_back_to_descriptor`
was asserting `detect_attached_chip("COM9", timeout=3.0)` but the
call site dropped the explicit 3.0s timeout override in #3446 so the
richer 15s default kicks in. Assertion now matches the actual call.
5/5 tests in `TestAutoDetectUploadPort` pass. Ruff clean.
Refs #3468 (unblocks on-silicon `bash autoresearch --pwm-dma-cl` port
detection for the SCT+DMA channels-API validation harness) and the
broader #3300 / #3450 LPC restoration meta.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR extends USB VCOM fingerprint matching in ChangesMulti-fingerprint VCOM detection
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Closed
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Newer LPC845-BRK / LPCXpresso boards ship with NXP's LPC-Link2 CMSIS-DAP firmware pre-flashed on the on-board debug probe. That firmware presents the LPC845's USART0 as a VCOM alongside the CMSIS-DAP HID interface at VID:PID 1FC9:0132 (NXP's own VID), not the community-pool 16C0:0483 used by the older LPCXpresso VCOM firmware.
ci/util/port_utils.pyonly knew about the latter, sobash autoresearch lpc845brkfailed at port detection on any board with the newer firmware.Change the map from single-VID:PID to tuple-of-VID:PIDs so an env accepts any of several firmware variants. All five LPC8xx canary envs now accept both fingerprints; the first port matching any listed pair wins.
Backwards compat
ENVIRONMENT_TO_VCOM_VID_PIDS(plural).ENVIRONMENT_TO_VCOM_VID_PIDas a shim derived from the first entry per env — deprecated, slated for removal once no in-repo callers remain.Tests
TestAutoDetectUploadPort— 5/5 pass:test_lpc845brk_lpcxpresso_vcom_fingerprint_matchestest_lpc845brk_lpc_link2_cmsis_dap_fingerprint_matchestest_lpc845brk_neither_fingerprint_matches_reports_bothtest_expected_environment_probe_failure_falls_back_to_descriptorafter autoresearch: chip-id probe 3 s timeout is too short for CP210x boards; add reset-strategy fallbacks #3446 dropped the explicittimeout=3.0override.Ruff clean.
Refs
bash autoresearch --pwm-dma-clport detection for AutoResearch: PWM+DMA clockless validation harness for LPC845 (paired sibling of #3456) #3468's SCT+DMA channels-API validation harness.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes