Author Topic: USB mounting in arm based lpc3250  (Read 32809 times)

nightrapper

  • Member
  • ***
  • Posts: 20
USB mounting in arm based lpc3250
« 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.
 

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB mounting in arm based lpc3250
« Reply #1 on: March 13, 2013, 12:35:42 am »
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.


nightrapper

  • Member
  • ***
  • Posts: 20
Re: USB mounting in arm based lpc3250
« Reply #2 on: March 13, 2013, 05:49:23 am »
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 ?


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB mounting in arm based lpc3250
« Reply #3 on: March 13, 2013, 12:59:23 pm »
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.

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: USB mounting in arm based lpc3250
« Reply #4 on: March 13, 2013, 01:47:53 pm »
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.

nightrapper

  • Member
  • ***
  • Posts: 20
Re: USB mounting in arm based lpc3250
« Reply #5 on: March 16, 2013, 01:05:30 am »
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.



Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB mounting in arm based lpc3250
« Reply #6 on: March 16, 2013, 11:39:34 am »

nightrapper

  • Member
  • ***
  • Posts: 20
Re: USB mounting in arm based lpc3250
« Reply #7 on: March 18, 2013, 06:40:33 am »
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]

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research

nightrapper

  • Member
  • ***
  • Posts: 20
Re: USB mounting in arm based lpc3250
« Reply #9 on: March 25, 2013, 06:15:24 am »
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]

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB mounting in arm based lpc3250
« Reply #10 on: March 25, 2013, 09:08:06 pm »
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?


nightrapper

  • Member
  • ***
  • Posts: 20
Re: USB mounting in arm based lpc3250
« Reply #11 on: March 26, 2013, 06:55:41 am »
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]

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB mounting in arm based lpc3250
« Reply #12 on: March 26, 2013, 10:44:50 pm »
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/

nightrapper

  • Member
  • ***
  • Posts: 20
Re: USB mounting in arm based lpc3250
« Reply #13 on: April 22, 2013, 01:49:01 am »
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:

Code: [Select]
uboot> usb reset                                                               

Quote
(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?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB mounting in arm based lpc3250
« Reply #14 on: April 22, 2013, 10:15:25 am »
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.