pyocd / pyOCD

Open source Python library for programming and debugging Arm Cortex-M microcontrollers
https://pyocd.io
Apache License 2.0
1.13k stars 484 forks source link

command "pyocd list", error occurred #1126

Closed lennvn closed 3 years ago

lennvn commented 3 years ago

Run command "pyocd list", error occurred, pyocd version >= 0.30: Successfully installed pyocd-0.30.0

PS C:\Users\wuze> pyocd list
0000671:WARNING:common:STLink and CMSIS-DAPv2 probes are not supported because no libusb library was found.
0000775:CRITICAL:__main__:No backend available
Traceback (most recent call last):
  File "d:\program files\python\python39\lib\site-packages\pyocd\__main__.py", line 402, in run
    self._COMMANDS[self._args.cmd](self)
    ConnectHelper.list_connected_probes()
    allProbes = ConnectHelper.get_all_connected_probes(blocking=False)
  File "d:\program files\python\python39\lib\site-packages\pyocd\core\helpers.py", line 82, in get_all_connected_probes
    allProbes = DebugProbeAggregator.get_all_connected_probes(unique_id=unique_id)
  File "d:\program files\python\python39\lib\site-packages\pyocd\probe\aggregator.py", line 64, in get_all_connected_probes
    probes += cls.get_all_connected_probes(unique_id, is_explicit)
  File "d:\program files\python\python39\lib\site-packages\pyocd\probe\picoprobe.py", line 335, in get_all_connected_probes
    return [cls(dev) for dev in PicoLink.enumerate_picoprobes()]
  File "d:\program files\python\python39\lib\site-packages\pyocd\probe\picoprobe.py", line 108, in enumerate_picoprobes
    return [PicoLink(probe) for probe in core.find(find_all=True, custom_match=FindPicoprobe(uid))]
  File "d:\program files\python\python39\lib\site-packages\usb\core.py", line 1299, in find
    raise NoBackendError('No backend available')
usb.core.NoBackendError: No backend available
newbrain commented 3 years ago

Ah, this is probably my fault. I'll try to reproduce it and come back with further comments/a solution as soon as feasible.

With libusb installed it does not happen - but that's not an excuse.

newbrain commented 3 years ago

Please check DPR #1128.

flit commented 3 years ago

@newbrain Thanks for responding so quickly!

flit commented 3 years ago

I'll get a new version out as soon as possible with the fix from #1128.