LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
 
Search this Thread
Old 03-03-2014, 04:58 PM   #1
eliasson
LQ Newbie
 
Registered: May 2011
Posts: 7

Rep: Reputation: 0
General USB testing ?


Hi,

I hope this is the correct forum for a USB testing question. I'm running Ubuntu 12.04, kernel 3.2.0-23. I've been looking at testing USB using a flash drive. My first question is simply, where is the latest usbtest.c file? I installed kernel sources, but that did not give me this file. I see that the usbtest.ko module is available which leads me to believe that this test can still be used, and that the source must be somewhere. When I try to run 'testusb -D /dev/sdb1', I get messages like:
unknown speed /dev/bus/usb/001/007 0
./testusb: /dev/sdb1 may see only control tests
can't open dev file r/w: No such file or directory

So it appears something is trying to run, and 001/007 corresponds to my flash device based on 'lsusb -v' output. I don't know if this is a configuration issue, or something else and maybe the source will help? Or maybe someone on the forum has some info?

TIA,
Anders
 
Old 03-26-2014, 11:36 PM   #2
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware & CentOS
Posts: 3,726
Blog Entries: 1

Rep: Reputation: Disabled
Hi:


Since lsusb is saying that /dev/bus/usb/001/007 0 is the flash drive than I would say maybe it's a configuration issue
Maybe another member will know more about configuration issue's. Sorry I don't know how to tell--

If something on the flash drive is trying to run it may be that it is not functioning because your machine is not set to boot to usb first. Unless that is not what you want.
Is the flash drive formatted with grub and a distribution on it?

This was the only article I could find on usbtest.c.
http://www.spinics.net/lists/linux-usb/msg103005.html

These links might help too-
http://www.filewatcher.com/m/usbtest.c.58031-0.html
http://www.linux-usb.org/usbtest/testusb.c
http://www.linux-usb.org/FAQ.html
http://ubuntuforums.org/search.php?searchid=2973910

If that doesn't help you could try opening the terminal and try running:
Code:
locate usbtest.c
The console should show you the path to the file.
Also you can try looking in lsmod where the modules and drivers are listed.

The usbtest.c might be in the Ubuntu Package Search-
http://ubuntuforums.org/search.php?searchid=2973910

Look in Synaptic Package Manager too it might be in there.

Last edited by Ztcoracat; 03-26-2014 at 11:42 PM.
 
Old 03-26-2014, 11:57 PM   #3
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware & CentOS
Posts: 3,726
Blog Entries: 1

Rep: Reputation: Disabled
If you had to you could download the file here:
http://code.ohloh.net/file?fid=lvoia...lected=true#L0

I checked on the file and it says:
Code:
usbtest.c
Which is a HTML document
from http://code.ohloh.net
 
Old 03-28-2014, 09:21 AM   #4
eliasson
LQ Newbie
 
Registered: May 2011
Posts: 7

Original Poster
Rep: Reputation: 0
Thanx for the reply/info. I've since moved on to working with the USB libraries such as usb & libusb. I'm accessing the flash device in a 'raw' mode, no partitions, no format, no OS. I can detach the existing kernel driver, claim the interface, and open the device. But I'm not writing data to the device successfully yet.

So my direction has changed but the issue is not yet resolved. If anyone has helpful hints for working with the usb/libusb library functions, I'd appreciate seeing such :^).

Regards,
Anders
 
Old 03-28-2014, 06:32 PM   #5
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware & CentOS
Posts: 3,726
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by eliasson View Post
Thanx for the reply/info. I've since moved on to working with the USB libraries such as usb & libusb. I'm accessing the flash device in a 'raw' mode, no partitions, no format, no OS. I can detach the existing kernel driver, claim the interface, and open the device. But I'm not writing data to the device successfully yet.

So my direction has changed but the issue is not yet resolved. If anyone has helpful hints for working with the usb/libusb library functions, I'd appreciate seeing such :^).

Regards,
Anders
Your Welcome.

Maybe ( I'm guessing) by learning how the usb/libusb libraries work in functionality and how they provide support and distribute it that will perhaps lead you to being able to manipulate them to perform the task/test you want to put in motion. Libraries are programs that do things. Not entirely sure what those things and processes are but it's worth finding out IMO-
Good Luck

http://www.dreamincode.net/forums/to...ing-libusb-10/
http://libusb.sourceforge.net/api-1.0/group__lib.html
 
Old 04-03-2014, 03:08 PM   #6
eliasson
LQ Newbie
 
Registered: May 2011
Posts: 7

Original Poster
Rep: Reputation: 0
Finally made good progress. Found some more code on-line that really helped, the xusb.c program example. So I now consider this request solved.

Anders
 
Old 04-03-2014, 04:52 PM   #7
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware & CentOS
Posts: 3,726
Blog Entries: 1

Rep: Reputation: Disabled
Glad to hear of the good progress--

Where did you find the xusb.c program?
 
Old 04-04-2014, 10:30 AM   #8
eliasson
LQ Newbie
 
Registered: May 2011
Posts: 7

Original Poster
Rep: Reputation: 0
I found a version here:

http://git.libusb.org/?p=libusb-pbat...xamples/xusb.c

I took the parts I needed for accessing 'bulk-only mass storage devices' and moved forward :^).

Anders
 
Old 04-04-2014, 09:33 PM   #9
Ztcoracat
Senior Member
 
Registered: Dec 2011
Distribution: Slackware & CentOS
Posts: 3,726
Blog Entries: 1

Rep: Reputation: Disabled
Looks good for future use. Thanks for posting the link.
Don't forget: mark your thread solved-

Have a good weekend-
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
usb webcam locking up usb when testing sound in skype glorsplitz Slackware 2 04-09-2012 07:26 PM


All times are GMT -5. The time now is 03:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration