You are not logged in.
I am new to Linux USB environment. I have a self-made USB device. I would like to know where can I start to write a program to control the USB device. I have read some of the resources, such as writing a kernel driver, and also using the libusb. I need to start from kernel space (kernel driver) or user space (libusb)?
I have tried libusb, but seems like the dmesg produce such message,
[ 3391.237570] usb 2-1.1: new full speed USB device number 47 using ehci_hcd
[ 3391.304093] usb 2-1.1: device descriptor read/64, error -32
[ 3391.473813] usb 2-1.1: device descriptor read/64, error -32
[ 3391.643519] usb 2-1.1: new full speed USB device number 48 using ehci_hcd
[ 3391.713381] usb 2-1.1: device descriptor read/64, error -32
[ 3391.883072] usb 2-1.1: device descriptor read/64, error -32
[ 3392.052907] usb 2-1.1: new full speed USB device number 49 using ehci_hcd
[ 3392.458626] usb 2-1.1: device not accepting address 49, error -32
[ 3392.525371] usb 2-1.1: new full speed USB device number 50 using ehci_hcd
[ 3392.931155] usb 2-1.1: device not accepting address 50, error -32
[ 3392.931444] hub 2-1:1.0: unable to enumerate USB device on port 1I think that is why libusb does not work since it is not yet recognized by the kernel.
So, now I am trying to start writing the kernel driver. I would like to know what header files and libraries do I need in order to compile the driver?
I have tried "-I/usr/src/linux-3.0-ARCH/include -I/usr/src/linux-3.0-ARCH/arch/x86/include" when compiling the source, but failed.
Please give me some advice.
Last edited by allencch (2011-11-14 00:41:54)
Offline
Wow.
I assume you have seen the canonical reference for Linux drivers. Especially, this chapter
What type of device is it? The system looks like it is trying to treat it as storage.
If it one of the I/O devices that appear as a serial port on the USB side, it is likely there may exist a driver for it already.
For really custom devices, I usually cheat and just go with a HID model. There are high level drivers for that too, all you need to do is define the reports.
If you are implementing things at the four base endpoints, you are a better man than I, whom I'll gladly buy a beer.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
ewaller, thanks for your great information. Besides that, the self-made device was a little bit faulty, due to the mistake of the builder. And now I can use libusb to access the device.
Offline