i.MX6Q: Communiction with a USB device

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

i.MX6Q: Communiction with a USB device

ソリューションへジャンプ
1,876件の閲覧回数
Tarek
Senior Contributor I

Hi All,

I need to connect a proprietary human interface USB device to i.MX6Q Nitrogen board. The device will send key press information and the userspace application running on i.MX6 should receive this information and perform certain functionality.

I would like to know if anyone implemented any similar program and which library was used?

I found that libusb is very useful but the package provided with LTIB is very old. I build this library but it's not working. There is a test example that comes with the library when ran it on  target it's not doing what it should do. In fact it's not doing anything!

Also I tried to build a more recent version of libusb but couldn't satisfy the dependency requirements.


What is the best method for implementing USB device drivers for i.MX6Q?

Thanks

ラベル(2)
0 件の賞賛
返信
1 解決策
1,072件の閲覧回数
Tarek
Senior Contributor I

I have installed the libusb package that comes with Yocto  libusb-1.0.9 and that works.

A good introduction to this library in:

http://www.dreamincode.net/forums/topic/148707-introduction-to-using-libusb-10/

A good example:

c_example_with_libusb-1.0 [ThingyLab]

The only problem is this version doesn't support hotplug. I need to detect the USB connect/disconnect events in my application.

Is there any other mechanism for detecting the USB hotplug events?

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,073件の閲覧回数
Tarek
Senior Contributor I

I have installed the libusb package that comes with Yocto  libusb-1.0.9 and that works.

A good introduction to this library in:

http://www.dreamincode.net/forums/topic/148707-introduction-to-using-libusb-10/

A good example:

c_example_with_libusb-1.0 [ThingyLab]

The only problem is this version doesn't support hotplug. I need to detect the USB connect/disconnect events in my application.

Is there any other mechanism for detecting the USB hotplug events?

0 件の賞賛
返信
1,072件の閲覧回数
Tarek
Senior Contributor I

I can't get the plugin functionality working but there is  a workaround.

libusb_interrupt_transfer() blocks until any data is received or if the device is unplugged. So I check the return value is not LIBUSB_SUCCESS then assume the device is disconnected and keep polling libusb_get_device_list() until my device appears again.