• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: LibUSB, OpenUSB and Sheeva  (Read 3010 times)
LuisAnton
Newbie
*

Karma: 0
Posts: 10


View Profile
« on: September 09, 2009, 08:55:55 AM »

This is my first post, so first of all, hello everyone!

We have recently adquired and successfully configured a Sheeva Plug. We have also successfully cross-compiled and executed a simple libusb example that queries and lists all usb devices connected to the Sheeva Plug.

Then, we tried to cross-compile and execute a program that used OpenUSB instead of libUSB for the same task (it's the testopenusb.c program that comes with OpenUSB, which works perfectly on my laptop with Ubuntu). While it did compile and run on the Sheeva, it freezes when it calls openusb_get_busid_list (even when openusb is correctly initialized with openusb_init, callsbacks are set with openusb_set_event_callback and the default timeout is defined with openusb_set_default_timeout).

We have also tried a program that uses OpenUSB for connecting to a given usb device, knowing its vendor and product ID, which we know for certain that it works (we have previously used it on 'normal' computers under Ubuntu). OpenUSB on Sheeva, however, does not find the device, even when it's perfectly visible with the libusb example and lsusb.

What could be wrong with OpenUSB and Sheeva? Something related to threads? Does anyone have experience working with USB devices on Sheeva?

Thank you!
Logged

LuisAnton
Newbie
*

Karma: 0
Posts: 10


View Profile
« Reply #1 on: September 11, 2009, 03:30:18 AM »

No one?

I'm attaching both files, if anyone is interested in trying them.

lsusb.c is the libUSB example which, once libusb-dev are installed on Sheeva, compiles and runs. It lists all connected USB devices, with their configurations and interfaces

testopenusb.c is basically the same example, using OpenUSB. However, although it compiles and runs, it freezes when looking for USB devices.

Any help would be appreciated.

* testopenusb.c (32.11 KB - downloaded 272 times.)
* lsusb.c (4.26 KB - downloaded 307 times.)
Logged

ptosch
Newbie
*

Karma: 0
Posts: 10


View Profile
« Reply #2 on: September 11, 2009, 02:01:02 PM »

Greetings,

Sorry for asking instead of helping:
What is Your intention of using OpenUSB, or in other words: what is the difference between both methods ?

cheers,
 Peter
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #3 on: September 11, 2009, 04:42:43 PM »

OpenUSB is thread-safe.  libusb isn't.
See http://sourceforge.net/projects/openusb/
Logged

LuisAnton
Newbie
*

Karma: 0
Posts: 10


View Profile
« Reply #4 on: September 12, 2009, 06:12:26 AM »

ptosh: It's just because we already have the program we need in OpenUSB. If OpenUSB does not work on the Sheeva, we will be forced to rewrite it for libUSB.

libUSB 0.1, the one on the repositories, does not admit callbacks. libUSB 1.0 does, so I guess we will install that one.

However, I just can't find a reason why OpenUSB would not work on Sheeva! Sad
Logged

Pages: [1]
Print
Jump to: