I am a college student,, and this summer I am working in a physics lab and have been given the task to write a device driver for a USB peripheral in linux for an experiment we are running. Basically I am just looking for the right resources to start this project (books, websites, ect..)
I have a decent knowledge of C, although it is mostly through systems programming, I have never dealt with hardware protocols and such. The idea is there is going to be a peripheral that I have to read data from whenever I get a signal from another piece of hardware, so I need to be able to bulk transfer from this USB device. The peripheral is not going to be a defined USB class, so I am also going to need to write the device driver for it. My main question is where do I start learning the syntax for this kind of stuff? I have been reading up on the USB specification already, which I assume is the first step. I have also read up on libusb, but IDK if I should use that or try to interface with the device in some other way, what do you guys suggest?
5 replies to this topic
#1
Posted 29 May 2010 - 08:49 PM
|
|
|
#2
Posted 31 May 2010 - 09:27 AM
same problem @B-80. I have to find a guide to write a driver/firmware to enable my code to read/write files into a USB device. I looked through the LibUsb library (using it in my IDE) but I can to transmit only a stream, i.e. a character sequence. I suppose I've to dodge the file system w a my driver to operate on device.
Guys, is there a guide or some source-code to create a driver compliant w USB 2.0 specs? Cheers..
Guys, is there a guide or some source-code to create a driver compliant w USB 2.0 specs? Cheers..
#3
Posted 31 May 2010 - 10:40 AM
Ultimately, all communications via USB will be a stream of characters. It's knowing WHAT characters to send that is the trick.
#4
Posted 01 June 2010 - 12:11 AM
Bulk transfer supports only stream of characters. My main problem is how to build a char sequence that permits to recognise a file in the file system and to put it into the usb device.
Suggestions?
Suggestions?
#5
Posted 01 June 2010 - 03:05 PM
It depends on the details of the device. You can both read and write to it, so you'll have to send it a message (write), and get a response (read).
#6
Posted 02 June 2010 - 03:21 AM
I solved with this part of code:
I wonder if I've really solved my problem with a system call? As a requirement of my task I have to work in Bulk-Transfer-Only mode that means using stream to communicate between host and USB mass storage.
snprintf( command, sizeof command, "sudo /bin/cp -p %s %s", source, destination ); l_iRet = system( command );
I wonder if I've really solved my problem with a system call? As a requirement of my task I have to work in Bulk-Transfer-Only mode that means using stream to communicate between host and USB mass storage.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









