Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picoprobe: exception raised when UID is specified but no Picoprobe is connected #1116

Closed
flit opened this issue Mar 9, 2021 · 1 comment · Fixed by #1117
Closed

Picoprobe: exception raised when UID is specified but no Picoprobe is connected #1116

flit opened this issue Mar 9, 2021 · 1 comment · Fixed by #1117

Comments

@flit
Copy link
Member

flit commented Mar 9, 2021

The symptom of this bug is the following AttributeError exception raised when a probe UID is specified but there is not a Picoprobe connected to USB.

0000616:CRITICAL:__main__:uncaught exception: 'NoneType' object has no attribute 'serial_number'
Traceback (most recent call last):
  File "/Volumes/projects/pyOCD-flit/pyocd/__main__.py", line 402, in run
    self._COMMANDS[self._args.cmd](self)
  File "/Volumes/projects/pyOCD-flit/pyocd/__main__.py", line 808, in do_commander
    PyOCDCommander(self._args, cmds).run()
  File "/Volumes/projects/pyOCD-flit/pyocd/commands/commander.py", line 65, in run
    if not self.connect():
  File "/Volumes/projects/pyOCD-flit/pyocd/commands/commander.py", line 164, in connect
    probe = ConnectHelper.choose_probe(
  File "/Volumes/projects/pyOCD-flit/pyocd/core/helpers.py", line 138, in choose_probe
    allProbes = ConnectHelper.get_all_connected_probes(blocking=blocking, unique_id=unique_id)
  File "/Volumes/projects/pyOCD-flit/pyocd/core/helpers.py", line 82, in get_all_connected_probes
    allProbes = DebugProbeAggregator.get_all_connected_probes(unique_id=unique_id)
  File "/Volumes/projects/pyOCD-flit/pyocd/probe/aggregator.py", line 58, in get_all_connected_probes
    probe = cls.get_probe_with_id(unique_id, is_explicit)
  File "/Volumes/projects/pyOCD-flit/pyocd/probe/picoprobe.py", line 339, in get_probe_with_id
    probe = PicoLink.enumerate_picoprobes(unique_id)
  File "/Volumes/projects/pyOCD-flit/pyocd/probe/picoprobe.py", line 110, in enumerate_picoprobes
    return PicoLink(core.find(custom_match=FindPicoprobe(uid)))
  File "/Volumes/projects/pyOCD-flit/pyocd/probe/picoprobe.py", line 59, in __init__
    self._probe_id = dev.serial_number
AttributeError: 'NoneType' object has no attribute 'serial_number'
@flit
Copy link
Member Author

flit commented Mar 9, 2021

cc @newbrain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant