Discussion:
[OpenOCD-devel] HIDAPI backend?
Renaud C.
2017-04-18 11:23:31 UTC
Permalink
Is there any reasons to prefer the hidraw backend versus the libusb
concerning hidapi? I've noticed that Ubuntu is shipping openocd with the
hidraw backend.

I've found that using the libusb backend, my CMSIS-DAP adapter is not
detected during the hid_enumerate() :

https://github.com/gnuarmeclipse/openocd/issues/12

Just trying to get some arguments to advocate for enforcing the hidraw
backend on the gnuarmeclipse build.
Paul Fertser
2017-04-18 12:10:26 UTC
Permalink
Hello,
Is there any reasons to prefer the hidraw backend versus the libusb concerning
hidapi? I've noticed that Ubuntu is shipping openocd with the hidraw backend. 
I've found that using the libusb backend, my CMSIS-DAP adapter is not detected
I've tested OpenOCD with hidapi-libusb on OpenWrt and it was able to
detect my adapter nicely. Can you please make sure it's not a
permissions issue? I'd rather prefer to make libusb backend work or at
least to fully understand its limitations.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:***@gmail.com
Renaud C.
2017-04-18 12:16:47 UTC
Permalink
Yes, I'm 100% sure this is not a permission issue as stated in the
gnuarmeclipse issue:

https://github.com/gnuarmeclipse/openocd/issues/12

I did some debug, and the `hid_enumerate()` doesn't returns that adapter
when using the libusb backend. Switching to the hidraw backend fixed it. I
didn't noticed anything wrong on the build script:

https://github.com/gnuarmeclipse/build-scripts/blob/master/scripts/build-openocd.sh
Post by Paul Fertser
Hello,
Post by Renaud C.
Is there any reasons to prefer the hidraw backend versus the libusb
concerning
Post by Renaud C.
hidapi? I've noticed that Ubuntu is shipping openocd with the hidraw
backend.
Post by Renaud C.
I've found that using the libusb backend, my CMSIS-DAP adapter is not
detected
I've tested OpenOCD with hidapi-libusb on OpenWrt and it was able to
detect my adapter nicely. Can you please make sure it's not a
permissions issue? I'd rather prefer to make libusb backend work or at
least to fully understand its limitations.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
Paul Fertser
2017-04-18 12:19:59 UTC
Permalink
Yes, I'm 100% sure this is not a permission issue as stated in the gnuarmeclipse
[1]https://github.com/gnuarmeclipse/openocd/issues/12
I did some debug, and the `hid_enumerate()` doesn't returns that adapter when
using the libusb backend. Switching to the hidraw backend fixed it. I didn't
Can you please provide strace log for the libusb backend? And HIDAPI
version. I can try to reproduce on my system here.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:***@gmail.com
Renaud Cerrato
2017-04-18 14:53:50 UTC
Permalink
Not sure you received my previous email with the attachments?
Sure, here it is (launched with sudo), along with the lsusb output. My
adapter is on /dev/bus/usb/003/062 - but we can see that there's no
SYS_OPEN to that device which confirms my `hid_enumerate()` observations.
hidapi is the 0.7.0
Post by Renaud C.
Post by Renaud C.
Yes, I'm 100% sure this is not a permission issue as stated in the
gnuarmeclipse
Post by Renaud C.
[1]https://github.com/gnuarmeclipse/openocd/issues/12
I did some debug, and the `hid_enumerate()` doesn't returns that
adapter when
Post by Renaud C.
using the libusb backend. Switching to the hidraw backend fixed it. I
didn't
Can you please provide strace log for the libusb backend? And HIDAPI
version. I can try to reproduce on my system here.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
Renaud C.
2017-04-18 15:02:24 UTC
Permalink
It looks like email with attachments are filtered out, so here's a copy
using pastebins. My adapter is on /dev/bus/usb/003/062 - but we can see
that there's no SYS_OPEN to that device which confirms my `hid_enumerate()`
observations:

https://pastebin.com/af5j4JtR
https://pastebin.com/RVkN003K

The hidapi version is the 0.7.0
Post by Renaud Cerrato
Not sure you received my previous email with the attachments?
Sure, here it is (launched with sudo), along with the lsusb output. My
adapter is on /dev/bus/usb/003/062 - but we can see that there's no
SYS_OPEN to that device which confirms my `hid_enumerate()` observations.
hidapi is the 0.7.0
Post by Renaud C.
Post by Renaud C.
Yes, I'm 100% sure this is not a permission issue as stated in the
gnuarmeclipse
Post by Renaud C.
[1]https://github.com/gnuarmeclipse/openocd/issues/12
I did some debug, and the `hid_enumerate()` doesn't returns that
adapter when
Post by Renaud C.
using the libusb backend. Switching to the hidraw backend fixed it. I
didn't
Can you please provide strace log for the libusb backend? And HIDAPI
version. I can try to reproduce on my system here.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
https://lists.sourceforge.net/lists/listinfo/openocd-devel
Paul Fertser
2017-04-18 15:09:44 UTC
Permalink
The hidapi version is the 0.7.0  
Oh my, can you please recheck with a recent version? I was testing
with 0.8.0-rc1. That 0.7.0 is really old.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:***@gmail.com
Paul Fertser
2017-04-18 15:16:12 UTC
Permalink
Post by Paul Fertser
The hidapi version is the 0.7.0  
Oh my, can you please recheck with a recent version? I was testing
with 0.8.0-rc1. That 0.7.0 is really old.
https://github.com/signal11/hidapi/commit/a991328721b3b39cbc90f562b87df0bb1eeaf5c4
and
https://github.com/signal11/hidapi/commit/ec24f931007d75e061d26d6f9705790913f72fa0
might make all the difference in this case.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:***@gmail.com
Renaud C.
2017-04-18 16:13:29 UTC
Permalink
Thanks Paul! Indeed, compiling against 0.8.0-rc1 made it... The
gnuarmeclipse build is using the 0.7.0 - I'm now able to fix their build
script!
Post by Paul Fertser
Post by Paul Fertser
Post by Renaud C.
The hidapi version is the 0.7.0
Oh my, can you please recheck with a recent version? I was testing
with 0.8.0-rc1. That 0.7.0 is really old.
https://github.com/signal11/hidapi/commit/a991328721b3b39cbc90f562b87df0bb1eeaf5c4
and
https://github.com/signal11/hidapi/commit/ec24f931007d75e061d26d6f9705790913f72fa0
might make all the difference in this case.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
Paul Fertser
2017-04-18 16:22:57 UTC
Permalink
Thanks Paul! Indeed, compiling against 0.8.0-rc1 made it... The gnuarmeclipse
build is using the 0.7.0 - I'm now able to fix their build script!
Thanks for taking care of that! Hope to see you contributing to
OpenOCD as well one day ;)
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:***@gmail.com
Liviu Ionescu
2017-04-19 04:36:13 UTC
Permalink
... arguments to advocate for enforcing the hidraw backend on the gnuarmeclipse build.
please try the pre-release and let me know if it works:

https://github.com/gnuarmeclipse/openocd/releases/tag/gae-0.10.0-20170418


regards,

Liviu

Loading...