Repository navigation
Conversation
This branch has not been deployed
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.
Fixes #2055.
What
StlinkProbe._get_board_id()slicesinfo['target_id_mbed_htm'][0:4]inside atrythat onlycatches
KeyError.stlink/detect/base.pydocuments_read_htm_ids()as returningNoneonfailure and then stores that
Nonein the same key, so anmbed.htmthat exists but has noparsable TargetID produces "key present, value None" — which raises
TypeErrorand escapes,aborting probe enumeration entirely.
Add
TypeErrorto the caught exceptions so the existing "we can live without the board ID"path handles it.
Why it started happening
The gate
if info['target_id_usb_id'] == self._link.serial_numberwas removed in 0.35.0, so theloop now slices for every enumerated MSD volume and only breaks on a match. The offending volume
therefore no longer needs to belong to the ST-Link: any volume with an unparsable
mbed.htmbreaks enumeration of every ST-Link on the machine.
usb_idgate before the sliceKeyError(none before 0.22.0)mainKeyErrorTesting
pyocd listbefore: single-lineError: 'NoneType' object is not subscriptable, exit code 1,no probe listed at all. After: exit code 0, ST-Link listed with
n/ain the Target column,other probes unaffected. Verified on Windows / Python 3.14 with an ST-Link whose firmware does
not answer
get_board_id()and a DAPLink volume whosembed.htmis a redirect page with noTargetID.
StlinkProbe.board_idnow returnsNoneinstead of raising, which is the documented intent ofthat block.
NoneNoneNoneTypeErrorNone"""""""0123…""0123""0123"