PORTS Forum
Ports and Interfaces => USB => Topic started by: nightrapper on March 12, 2013, 09:45:44 pm
-
hi,
i am new to linux as well as usb,which i am using in one of my project.
I am having LPC3250 board,which i have configured in Host mode,using the menuconfig(linux kerenl 2.6.34).When i am attaching a USB device to the usb port,the device is getting detected which i am think based on my below observation
1.USB led blinking
2.In the linux ported on lpc3250 board file system when i am using this command mdev -s , sda is appearing in the dev directory
But when i try to mount the usb using this command mount /dev/sda1 /media1
it is giving this problem as mentioned below
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
sd 8:0:0:0: [sda] Unhandled error code
sd 8:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00
sd 8:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 00 00 00 02 00 00 02 00
end_request: I/O error, dev sda, sector 2
EXT2-fs (sda): error: unable to read superblock
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
sd 8:0:0:0: [sda] Unhandled error code
sd 8:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00
sd 8:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 00 00 00 00 00 00 08 00
end_request: I/O error, dev sda, sector 0
Buffer I/O error on device sda, logical block 0
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
sd 8:0:0:0: [sda] Unhandled error code
sd 8:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00
sd 8:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 00 00 00 00 00 00 10 00
end_request: I/O error, dev sda, sector 0
Buffer I/O error on device sda, logical block 0
Buffer I/O error on device sda, logical block 1
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
sd 8:0:0:0: [sda] Unhandled error code
sd 8:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00
sd 8:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 00 00 00 08 00 00 10 00
end_request: I/O error, dev sda, sector 8
Buffer I/O error on device sda, logical block 1
Buffer I/O error on device sda, logical block 2
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
sd 8:0:0:0: [sda] Unhandled error code
sd 8:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00
sd 8:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 00 00 00 10 00 00 10 00
end_request: I/O error, dev sda, sector 16
Buffer I/O error on device sda, logical block 2
Buffer I/O error on device sda, logical block 3
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
sd 8:0:0:0: [sda] Unhandled error code
sd 8:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00
sd 8:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 00 00 00 18 00 00 08 00
end_request: I/O error, dev sda, sector 24
Buffer I/O error on device sda, logical block 3
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
sd 8:0:0:0: [sda] Unhandled error code
sd 8:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00
sd 8:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 00 00 00 00 00 00 01 00
end_request: I/O error, dev sda, sector 0
FAT: unable to read boot sector
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
usb 1-1: reset full speed USB device using usb-ohci and address 10
sd 8:0:0:0: [sda] Unhandled error code
sd 8:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00
sd 8:0:0:0: [sda] CDB: cdb[0]=0x28: 28 00 00 00 00 00 00 00 01 00
end_request: I/O error, dev sda, sector 0
FAT: unable to read boot sector
mount: mounting /dev/sda on /media failed: Input/output error
Please help me out with this problem as i am struck in it for over a month.
Please do reply if i am not clear in presenting my problem.
-
The device is an off-the-shelf flash drive, not a device you're developing? Try different drives.
A protocol analyzer will show what is happening on the bus. If you don't have a hardware-based analyzer, in Linux, you can use usbmon and vusb-analyzer or wireshark.
-
SIr,
My mail will be lengthy but please bear with it.
I am not developing the device,and i tried with different USB but still the same problem comes.
I am following this procedure.
1.Board is ARM based LPC3250 board with ISP1301 transceiver chip(Linux2.6.24 kernel is ported on board) configured in host mode (hardware wise),to which i am attaching my device.You can see the attachment for the diagram
As soon as i attach the USB following message appears
ISP1301 Vendor ID : 0x04cc
ISP1301 Product ID : 0x1301
ISP1301 Version ID : 0x0210
usb-ohci usb-ohci: at 0xf3120000, irq 0
usb-ohci usb-ohci: pnx4008 OHCI
usb-ohci usb-ohci: new USB bus registered, assigned bus number 1
usb-ohci usb-ohci: irq 59, io mem 0xf3120000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: pnx4008 OHCI
usb usb1: Manufacturer: Linux 2.6.39.2 ohci_hcd
usb usb1: SerialNumber: usb-ohci
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
2.In the linux ported on development board following procedure i follow to mount the USB
~ # ls
bin etc home linuxrc sbin usr
dev ftp lib proc tmp var
~ # mkdir sys
~ # mkdir media
~ # ls
bin etc home linuxrc proc sys usr
dev ftp lib media sbin tmp var
~ # dmesg|tail
usb-storage: Attempting to get CSW (2nd try)...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x19 R 188 Stat 0x0
usb-storage: scsi cmd done, result=0x0
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI removable disk
usb-storage: *** thread sleeping.
Now scan the sysfs and populate /dev using
~ # mount -t sysfs sysfs /sys
~ # mdev -s
mdev: mknod mtd1ro: No space left on device
~ # fdisk -l
-sh: fdisk: not found
# mount /dev/sda /media
usb 1-1: reset full speed USB device number 2 using usb-ohci
usb 1-1: reset full speed USB device number 2 using usb-ohci
usb 1-1: reset full speed USB device number 2 using usb-ohci
usb 1-1: reset full speed USB device number 2 using usb-ohci
usb 1-1: reset full speed USB device number 2 using usb-ohci
mount: mounting /dev/sda on /media failed: Invalid argument
In menuconfig in Linux i have enabled the following option
USB support
<*> Support for Host-side USB
- USB verbose debug messages
- USB announce new devices
*** Miscellaneous USB options ***
- USB device filesystem (DEPRECATED)
- USB device class-devices (DEPRECATED)
- Rely on OTG Targeted Peripherals List
*** USB Host Controller Drivers ***
<* > ISP1362 HCD support
<*> OHCI HCD support
*** NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may ***
*** also be needed; see USB_STORAGE Help for more info ***
<*> USB Mass Storage support
- USB Mass Storage verbose debug
Sir i want to ask a question since i am using isp1301 chip i don't find any option for enabling it in menuconfig, i enabled ISP1362 is it okay,if not then how to include ISP1301 ?
-
Enter
mount
to see if the OS mounted the drive automatically.
Does the drive use ntfs? See:
http://forum.tinycorelinux.net/index.php?topic=8446.0
The ISP1301 seems to have its own Linux driver.
http://lxr.free-electrons.com/source/drivers/usb/phy/isp1301.c
I don't know offhand how compatible the two chips are.
-
I don't know what the logging actually means, but I'd be trying to work out at what level the failure happens. Is this a failure the USB level, did the CBW actually get sent successfully, and did the CSW get received successfully. If they aren't I'd be trying to see what status was found in the OHCI transfer descriptor.
Or is this a failure at the mass storage level, the CSW was successfully received but the MSC driver interpreted it as an error. If that were the case I'd expect the MSC driver to be issuing a mode sense to ask the drive what its problem is.
These would start to isolate the problem for you.
As Jan mentions, a protocol analyser would probably tell you all that without further effort.
Also are you expecting your device to be full speed, not high speed? I'm assuming as the logging mentions OHCI its a full speed device.
-
Sir,
I entered mount following was the output
~ # mount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw,relatime)
proc on /proc type proc (rw,relatime)
I have downloaded the isp1301.c file and compiled as a loadable module in the kernel as below
1. loaded the kernel on the board.
2.~ # ls
bin etc home linuxrc sbin usr
dev ftp lib proc tmp var
~ # nfs(file system on the board to run my executable)
~# mount -t nfs -o nolock 192.168.1.10:/home/amit/nfs /nfs
the folder gets mounted on the board
but then again when i follow the procedure to install USB same problem occurring.
And about protocol analyser i am not able to use it,i have wire-shark installed but we use it for network analysis.How to use it for USB.
I installed Virtual usb analyser but after installation i click the button nothing appears.... please guide me.
-
Capture logs with usbmon.
https://www.kernel.org/doc/Documentation/usb/usbmon.txt
Then see:
http://vusb-analyzer.sourceforge.net/tutorial.html
Or search on
wireshark usb
-
Sir,
The USBMON is working on my system.When i connect USB to my linux pC command works and its output i am collecting in 1.mon.out ,this file i am attaching.
but this command is not running in the lpc board on which i have ported the linux kernel.
mount -t debugfs none_debugs /sys/kernel/debug
no such file /directory. And if i try to create debug file it says cannot create such file
### Application running ...
~ #
~ #
~ # ls
bin etc home linuxrc sbin usr
dev ftp lib proc tmp var
~ # mkdir sys
~ # mount -t sysfs sysfs /sys
~ # ls sys/
block class devices fs module
bus dev firmware kernel power
~ # ls sys/kernel/
mm notes uevent_helper uevent_seqnum
[attachment deleted by admin]
-
https://www.kernel.org/doc/Documentation/usb/usbmon.txt
says:
Mount debugfs (it has to be enabled in your kernel configuration)
Also see:
http://www.linuxforu.com/2010/10/debugging-linux-kernel-with-debugfs/
http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/ch09s07.html
-
SIr,
connected the device to USB trace and the result are attached in the file.
This doc would gives the details of USB i am connecting to the board.
The USB problen is still not over same error messages are coming.
[attachment deleted by admin]
-
The file you posted shows the descriptors and that the USBSTOR service was assigned, but it doesn't show any logging of attempted data transfers.
See Barry's suggestions earlier.
How was the drive formatted? Does your system support that file system?
-
sir,
I am attaching the log file snapshot for data transfer in USB attached to the windows system
Drive i formated using the tool in linux (GParted Partition Editor tool) to ext2 format,and this file system i have enabled in menuconfig file.
[attachment deleted by admin]
-
OK, the log file shows some transfers. However, if your software doesn't decode them, you will need to do so to find out what SCSI commands or other data they are transferring.
http://lvr.com/mass_storage.htm#Specifications
You might also find more help on a Linux forum such as
http://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/
-
Sir,
I tried out to mount the usb first in the u-boot of the board,following is the description:
We are having our own custom board based on the FDI design,on which we are not able to mount USB.
In the eaboard configuration files support for usb in the u-boot is there and we have commands
to check the usb inserted.
But this was not the case with FDI board,there were no commands for usb in uboot.
So we inserted the files from the eaboard to our code and we were able to check USB command in u-boot.
my query are
When i am executing the below command following errors are coming:
uboot> usb reset
(Re)start USB...
USB:
ISP1301 Vendor ID : 0x04cc
ISP1301 Product ID : 0x1301
ISP1301 Version ID : 0x0210
scanning bus for devices... 2 USB Device(s) found
scanning bus for storage devices... ERROR: USB-error: DEVICENOTRESPONDId
not provide a handshake (OUT) (5)
ERROR: USB-error: DEVICENOTRESPONDING: Device did not respond to token (IN) or d
not provide a handshake (OUT) (5)
ERROR: USB-error: DATAOVERRUN: The amount of data returned by the endpoint excd
either the size of the maximum data packet allowed
from the endpoint (found in MaximumPacketSize field
of ED) or the remaining buffer size. (8)
ERROR: USB-error: DATAOVERRUN: The amount of data returned by the endpoint exced
either the size of the maximum data packet allowed
from the endpoint (found in MaximumPacketSize field
of ED) or the remaining buffer size. (8)
ERROR: USB-error: DATAOVERRUN: The amount of data returned by the endpoint excd
either the size of the maximum data packet allowed
from the endpoint (found in MaximumPacketSize field
of ED) or the remaining buffer size. (8)
ERROR: USB-error: DATAOVERRUN: The amount of data returned by the endpoint exced
either the size of the maximum data packet allowed
from the endpoint (found in MaximumPacketSize field
of ED) or the remaining buffer size. (8)
ERROR: USB-error: DATAOVERRUN: The amount of data returned by the endpoint excd
either the size of the maximum data packet allowed
from the endpoint (found in MaximumPacketSize field
of ED) or the remaining buffer size. (8)
ERROR: USB-error: DATAOVERRUN: The amount of data returned by the endpoint exced
either the size of the maximum data packet allowed
from the endpoint (found in MaximumPacketSize field
of ED) or the remaining buffer size. (8)
ERROR: USB-error: DATAOVERRUN: The amount of data returned by the endpoint excd
either the size of the maximum data packet allowed
from the endpoint (found in MaximumPacketSize field
of ED) or the remaining buffer size. (8)
ERROR: USB-error: DATAOVERRUN: The amount of data returned by the endpoint exced
either the size of the maximum data packet allowed
from the endpoint (found in MaximumPacketSize field
of ED) or the remaining buffer size. (8)
ERROR: USB-error: DATAOVERRUN: The amount of data returned by the endpoint excd
either the size of the maximum data packet allowed
from the endpoint (found in MaximumPacketSize field
of ED) or the remaining buffer size. (8)
ERROR: USB-error: DATAOVERRUN: The amount of data returned by the endpoint exced
either the size of the maximum data packet allowed
from the endpoint (found in MaximumPacketSize field
of ED) or the remaining buffer size. (8)
** Can't read Driver Desriptor Block **
ERROR: USB-error: DATAOVERRUN: The amount of data returned by the endpoint excd
either the size of the maximum data packet allowed
from the endpoint (found in MaximumPacketSize field
of ED) or the remaining buffer size. (8)
ERROR: USB-error: DATAOVERRUN: The amount of data returned by the endpoint exced
either the size of the maximum data packet allowed
from the endpoint (found in MaximumPacketSize field
of ED) or the remaining buffer size. (8)
1 Storage Device(s) found
so can someone suggest where the problem is?
-
You have three specific errors to investigate:
ERROR: USB-error: DEVICENOTRESPONDId
not provide a handshake (OUT) (5)
I believe this means that an endpoint didn't return NAK, ACK, or NYET in the status phase of an OUT transaction.
ERROR: USB-error: DEVICENOTRESPONDING: Device did not respond to token (IN) or d
not provide a handshake (OUT) (5)
Same as above or the endpoint gave no response to an IN token packet.
ERROR: USB-error: DATAOVERRUN: The amount of data returned by the endpoint excd
either the size of the maximum data packet allowed
from the endpoint (found in MaximumPacketSize field
of ED) or the remaining buffer size.
An endpoint should return bMaxPacketSize or the number of bytes requested, whichever is larger.
A hardware protocol analyzer would show what is happening on the bus.
-
Sir,
I would be trying hardware usb analyzer tool tomorrow and then would post the results.....
But i have some thing to clarify:
Our controller board is having OHCI host controller and the device we are attaching is EHCI device...are they compatible and if not is there any
way to connect the 2. Does this means we can connect only USB 1.1 to LPC32xx board in host mode and not usb 2.0?
In data sheet of lpc32xx it says USB OTG (On-The-Go) is a supplement to the USB 2.0 specification .Does this means that lpc32xx support
USB 2.0 in OTG mode only?
-
Only hosts are EHCI. A device can be low, full, high speed or SuperSpeed. Some devices support two speeds.
The original OTG spec was a supplement to USB 2.0. The USB 3.0 spec now also includes OTG.
-
Being OHCI, you host would support full speed only. (As Jan mentiones, OHCI, and EHCI apply to hosts not devices.) Any high speed device should also support full speed. A device which wants to be high speed doesn't have to function at full speed, but its supposed to at least enumerate and tell you it has no function. I can't think of any high speed capable devices which don't actually have some function at full speed.
So basically you shouldn't have any problem, except things will be slow.
-
Sir,
I am attaching the snapshot and the file we collected while testing the USB on the ellisys protocol analyzer.Please find the attachment.
the resistor value we used for I2c pull up was 500ohm.
[attachment deleted by admin]
-
The analyzer shows incomplete IN transactions for the Read command and no data returned for Request Sense.
-
Sir,
Sorry for the late reply.
When I am testing the USB on the Ellisys protocol analyzer through CPU (Linux OS), It is executed successfully. I didn't get any errors. If the same thing done through the controller board (Having LPC3250 micro controller) I am getting errors. Why those errors are coming, Please kindly explain me.
And also I am attaching both snapshots while testing the USB through Linux & LPC3250 board.
[attachment deleted by admin]
-
Sir
you replied
"analyzer shows incomplete IN transactions for the Read command and no data returned for Request Sense"
What the reason for it.Can you just explain it little so that i can look into it?
Is this problem of USB i am testing or the pull up we are using in the circuit,we tried different combination of pull up but still the result is same?
-
Board.ufo shows a request for 512 bytes. The device returns 192 bytes and then apparently doesn't ACK further requests for data or return a STALL. The host gives up after 3 tries.
I think the host should still attempt to receive a CSW.
In the mass storage bulk only spec, see case 5 in "13 cases":
http://www.usb.org/developers/devclass_docs#approved
-
Sir,
The problem with ISP1301 still persist.
In new board we used micrel 2555 chip in place of isp 1301 and and in linux kernel we added the micrel patch file to linux kernel,the usb is working fine.
What i found is that it may be because of the hardware problem in the board that the USB was not working,as in our new board some protection circuit is provided on the board as per datasheet.
As per to my satisfaction i am not sure where the problem was hardware or software. If i assume that it is software problem following thing i want to do please guide me wither i am write or wrong.
1.Write a device driver for the usb and test it
i am reading (Designing and Programming Devices and Embedded Hosts -Jan Axelson) which would help me out to understand the USB working procedure.
-
I don't know the reason for the problem you were seeing with the ISP1301. However, replacing it with a different chip makes sense since I believe the ISP1301 has been discontinued.