pyocd / pyOCD

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

Which python hidapi package is used #1164

Closed LeeChunHei closed 3 years ago

LeeChunHei commented 3 years ago

I would like to ask where can I install that the correct python hid API package to use the hidapi backend. Right now I installed this python package via pip. However, when I run pyocd, it warned me that module 'hid' has no attribute 'device'. I looked at pyhidapi source code and noticed no attribute called device, but there is an attribute called Device. Did I install the wrong python package or there is some typo in pyOCD when using hidapi backend? It not likely pyhidapi changed its attribute naming as when I use git blame, the Device attribute is right there at the very beginning.

LeeChunHei commented 3 years ago

Sorry, I think I use the wrong one before. I should use this one https://github.com/trezor/cython-hidapi

flit commented 3 years ago

Yup, cython-hidapi is the one. The package name on PyPI is simply 'hidapi'. If you install pyocd via pip either from PyPI or locally from the git repo, you should get all the necessary dependencies and not have to install them manually.