This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB host mode functionality on OMAP35x EVM

Connector P16 on the OMAP35x EVM is a USB mini-AB connector.  I'm trying to test basic functionality of this USB interface with a USB mass storage device (i.e. a thumb drive), but the kernel does not seem to recognize the drive.  I'm connecting the the USB drive to a female-to-female USB connector which is in turn connected to a USB Type A to Mini B adapter cable.  Can someone offer any suggestions as to what might be going wrong?

I'm not terribly familiar with USB and mass storage.  By what name should I expect the device to show up in the /dev dir?  If I have connected the USB device incorrectly, how else can I convert the Type A plug of the USB drive to the Mini AB receptacle of the EVM board?

Thanks.

 

 

  • Though I have not tried this on the Mistral EVM, I have gone through this process on the Beagle Board (which should work about the same) so I can give a couple suggestions/thoughts based on that:

    1. To start I would verify that your mini A to standard B adapter is really mini A on the EVM end, it seems these sorts of adapters are particularly rare and that mini B to standard B is more common. The Wikipedia USB article shows the connector types and gives the pinout, essentially you need to ensure that pin 4 is grounded (can be achieved by shorting pins 4 and 5), this being said you can verify the connector is truly a mini A with a multimeter. In my case I ended up taking a mini B to standard B and modifying it to be a mini A to standard B by shorting pins 4 and 5 within the connector using a fine tipped soldering iron and a microscope (this is a bit of a hack I would avoid if possible).

    2. The second issue at least with the Beagle was power, though I believe a USB thumb drive is probably low current enough to work here, many devices like keyboards can draw more than the mini AB USB port can handle, so the solution is to utilize an externally powered hub.

    3. Once any potential hardware issues are out of the way you should see a message pop up on the terminal when you plug in a USB device, if it is recognized properly it should show as a /dev device in the message that you can take and mount to access the mass storage device.

    4. You may also find that not all USB devices will be recognized properly, I would expect your thumb drive to work, though it is always possible that it has some minor unique quality that causes trouble in Linux, a bit of a seperate example here is that the standard Dell USB keyboard I tried first would not work properly but a more generic USB keyboard would (I believe the extra media buttons on the Dell keyboard confused the Linux driver).

  • You would require a Mini-A to B adapter.  The Mini-A end will connect to OMAP EVM and the B end would connect to your thumb drive end.  In this configuration you should be able work with your thumb drive.

    You could also get a Mini-A (plug) to A receptacle adapters and with this you can interface with commercial USB devices like any normal PC would do.

     

    regards

    swami

  • Thanks for the responses Swami and Bernie.  That all makes some sense.  However, I'm using the mini-to-standard cable provided by Mistral with the EVM, and from what I can tell it's actually a mini-B-to-standard.  So why wouldn't Mistral have provided a mini-A-to-standard cable?  This implies that anyone who wants to test for USB mass storage support has to go purchase a standard female-to-female adapter (A-to-A) plus a mini-B-to-standard cable, correct?  (Or as you suggest, a mini-A-to-standard A adapter.  I'll search for one of those too.)

    Does anyone from Mistral have any clarification on this?

     

  • I think that would explain it, the cable that came with the EVM (which I was not sure if they were still including or not) would be for connecting the EVM as a slave device, so you could connect the EVM to a PC. It could be argued that a mini A would have been more useful than the mini B cable, though you could actually use either of them depending on if you wanted to use the board as a USB master or as a USB slave.

  • I think I understand this now, but your comment about "you could actually use either of them..." is confusing me.  I understand it as follows:  The mini-B-plug-to-Standard-A-plug provided with the Mistral OMAP 35x EVM is required in the case of the EVM acting as a USB slave device and connected to some USB host device (like a PC)?  Additionally, a mini-A-plug-to-Standard-A-receptacle (not provided with EVM) is required in the case of the EVM acting as a USB host and connected to some USB slave device (like a mass storage device/thumb drive)?

    Is this correct?  One adapter only allows use of the EVM USB port as a slave device; another adapter only allows use of the EVM USB port as a host.

    By the way, do you have suggestions as to where to find/purchase a mini-A-plug-to-standard-A-receptacle adapter?

     

  • Your understanding is correct, my statement was a bit confusing, I was just trying to get across the idea that the mini B cable that comes with the EVM still has a use, though it is not for connecting to a USB slave. You could make the cable work for your purposes if you shorted pins 4 and 5 together, which you may end up doing if you cannot find an adapter.

    In my case I found a mini B male to standard A female adapter and modified it to work as mini B, you may be able to find an actual mini A male to standard A female at an electronics store, I have seen them before in some USB adapter kits though I have not found one in a retail store as a stand alone adapter.

    https://serialio.com//store/product_info.php?products_id=456 is the closest to what I have used

    http://www.cooldrives.com/3usb20tomi4c.html claims to be mini A though you would need a barrel connector to adapt the standard A male end to connect to a drive

    http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=WM17494-ND looks like it would work if you had a USB hub that has a mini B female connector on it

  • Thanks, that a big help.  I'll let you know how it turns out.

     

  • I've now got a mini-A-to-standard-A(receptacle) to allow plugging a USB thumb drive to the OMAP35x EVM.  Two different USB drives are recognized differently, but neither seems to be correct.  The first drive is an older Lexar drive and never seems to be detected successfully (output below).  The second device (Kingston DataTraveler) seems to enumerate OK once, then disconnects, then enumberates OK a second time and I'm able to mount it via /dev/sda1.  Can you tell (1) what might be going wrong on the LEXAR device and (2) why it appears to take two tries to properly connect to the Kingston device?  (This is all using SDK-1.0.0; same results hot-plugging or having plugged in at POR.)

    LEXAR:

    [root@OMAP3EVM /]# musb_stage0_irq 597: OTG STATE: A_idle
    musb_stage0_irq 638: VBUS_ERROR in a_idle (91, <VBusValid), retry #1, port1 0000
    0100                                                                           
    musb_stage0_irq 699: CONNECT (a_host) devctl 5d                                
    usb 1-1: new high speed USB device using musb_hdrc and address 2               
    usb 1-1: Product: JUMPDRIVE SPORT                                              
    usb 1-1: Manufacturer: LEXAR MEDIA                                             
    usb 1-1: SerialNumber: 302AC206152432200804                                    
    usb 1-1: configuration #1 chosen from 1 choice                                 
    scsi0 : SCSI emulation for USB Mass Storage devices                            
    scsi 0:0:0:0: Direct-Access     LEXAR    JUMPDRIVE SPORT  1000 PQ: 0 ANSI: 0 CCS
    musb_stage0_irq 638: VBUS_ERROR in a_host (91, <VBusValid), retry #1, port1 0000
    0503                                                                           
    musb_stage0_irq 699: CONNECT (a_host) devctl 5d                                
    usb 1-1: USB disconnect, address 2                                             
    sd 0:0:0:0: [sda] READ CAPACITY failed                                         
    sd 0:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00                        
    sd 0:0:0:0: [sda] Sense not available.                                         
    sd 0:0:0:0: [sda] Write Protect is off                                         
    sd 0:0:0:0: [sda] Assuming drive cache: write through                          
    sd 0:0:0:0: [sda] Attached SCSI removable disk                                 
    usb 1-1: new high speed USB device using musb_hdrc and address 3               
    usb 1-1: Product: JUMPDRIVE SPORT                                              
    usb 1-1: Manufacturer: LEXAR MEDIA                                             
    usb 1-1: SerialNumber: 302AC206152432200804                                    
    usb 1-1: configuration #1 chosen from 1 choice                                 
    scsi1 : SCSI emulation for USB Mass Storage devices                            
    scsi 1:0:0:0: Direct-Access     LEXAR    JUMPDRIVE SPORT  1000 PQ: 0 ANSI: 0 CCS
    musb_stage0_irq 638: VBUS_ERROR in a_host (91, <VBusValid), retry #1, port1 0000
    0503                                                                           
    musb_stage0_irq 699: CONNECT (a_host) devctl 5d                                
    usb 1-1: USB disconnect, address 3                                             
    sd 1:0:0:0: [sda] READ CAPACITY failed                                         
    sd 1:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00                        
    sd 1:0:0:0: [sda] Sense not available.                                         
    sd 1:0:0:0: [sda] Write Protect is off                                         
    sd 1:0:0:0: [sda] Assuming drive cache: write through                          
    sd 1:0:0:0: [sda] Attached SCSI removable disk                                 
    usb 1-1: new high speed USB device using musb_hdrc and address 4               
    usb 1-1: Product: JUMPDRIVE SPORT                                              
    usb 1-1: Manufacturer: LEXAR MEDIA                                             
    usb 1-1: SerialNumber: 302AC206152432200804                                    
    usb 1-1: configuration #1 chosen from 1 choice                                 
    scsi2 : SCSI emulation for USB Mass Storage devices                            
    scsi 2:0:0:0: Direct-Access     LEXAR    JUMPDRIVE SPORT  1000 PQ: 0 ANSI: 0 CCS
    musb_stage0_irq 638: VBUS_ERROR in a_host (91, <VBusValid), retry #1, port1 0000
    0503                                                                           
    musb_stage0_irq 699: CONNECT (a_host) devctl 5d                                
    usb 1-1: USB disconnect, address 4                                             
    sd 2:0:0:0: [sda] READ CAPACITY failed                                         
    sd 2:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00                        
    sd 2:0:0:0: [sda] Sense not available.                                         
    sd 2:0:0:0: [sda] Write Protect is off                                         
    sd 2:0:0:0: [sda] Assuming drive cache: write through                          
    sd 2:0:0:0: [sda] Attached SCSI removable disk                                 
    usb 1-1: new high speed USB device using musb_hdrc and address 5               
    usb 1-1: Product: JUMPDRIVE SPORT                                              
    usb 1-1: Manufacturer: LEXAR MEDIA                                             
    usb 1-1: SerialNumber: 302AC206152432200804                                    
    usb 1-1: configuration #1 chosen from 1 choice

    repeats...

     

    Kingston:

    [root@OMAP3EVM /]#                                                             
    [root@OMAP3EVM /]# musb_stage0_irq 597: OTG STATE: A_idle                      
    musb_stage0_irq 638: VBUS_ERROR in a_idle (91, <VBusValid), retry #1, port1 0000
    0100                                                                           
    musb_stage0_irq 699: CONNECT (a_host) devctl 5d                                
    usb 1-1: new high speed USB device using musb_hdrc and address 2               
    usb 1-1: Product: DataTraveler 2.0                                             
    usb 1-1: Manufacturer: Kingston                                                
    usb 1-1: SerialNumber: 20080125000000000000044F                                
    usb 1-1: configuration #1 chosen from 1 choice                                 
    scsi0 : SCSI emulation for USB Mass Storage devices                            
    scsi 0:0:0:0: Direct-Access     Kingston DataTraveler 2.0 1.00 PQ: 0 ANSI: 2   
    sd 0:0:0:0: [sda] 7856128 512-byte hardware sectors (4022 MB)                  
    sd 0:0:0:0: [sda] Write Protect is off                                         
    sd 0:0:0:0: [sda] Assuming drive cache: write through                          
    sd 0:0:0:0: [sda] 7856128 512-byte hardware sectors (4022 MB)                  
    sd 0:0:0:0: [sda] Write Protect is off                                         
    sd 0:0:0:0: [sda] Assuming drive cache: write through                          
     sda:musb_stage0_irq 638: VBUS_ERROR in a_host (91, <VBusValid), retry #1, port1
     00000503                                                                      
    musb_stage0_irq 699: CONNECT (a_host) devctl 5d                                
    usb 1-1: USB disconnect, address 2                                             
    sd 0:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00                        
    end_request: I/O error, dev sda, sector 0                                      
    Buffer I/O error on device sda, logical block 0                                
    sd 0:0:0:0: [sda] Result: hostbyte=0x07 driverbyte=0x00                        
    end_request: I/O error, dev sda, sector 0
    Buffer I/O error on device sda, logical block 0
     unable to read partition table
    sd 0:0:0:0: [sda] Attached SCSI removable disk
    usb 1-1: new high speed USB device using musb_hdrc and address 3
    usb 1-1: Product: DataTraveler 2.0
    usb 1-1: Manufacturer: Kingston
    usb 1-1: SerialNumber: 20080125000000000000044F
    usb 1-1: configuration #1 chosen from 1 choice
    scsi1 : SCSI emulation for USB Mass Storage devices
    scsi 1:0:0:0: Direct-Access     Kingston DataTraveler 2.0 1.00 PQ: 0 ANSI: 2
    sd 1:0:0:0: [sda] 7856128 512-byte hardware sectors (4022 MB)
    sd 1:0:0:0: [sda] Write Protect is off
    sd 1:0:0:0: [sda] Assuming drive cache: write through
    sd 1:0:0:0: [sda] 7856128 512-byte hardware sectors (4022 MB)
    sd 1:0:0:0: [sda] Write Protect is off
    sd 1:0:0:0: [sda] Assuming drive cache: write through
     sda: sda1
    sd 1:0:0:0: [sda] Attached SCSI removable disk

    [root@OMAP3EVM /]#

     

  • Also, if the Kingston drive is removed and reconnected, it is not re-detected.

     

  • Are you unmounting before removing drive?  I am wondering if this is more related to the process of removing the drive cleanly (similar to safely removing USB devices in windows).

  • The problem with the Lexar Drive seems to be related to the capabality of the EVM to drive current over USB bus.  Can you connect a good self powered USB hub to OMAP EVM and connect the Lexar drive to it? The Lexar drive should work fine in that config.  I think the same reasoning applies to the Kingston Stick.

    regards

    swami

  • I tried out two USB flash drives on my EVM here and both were able to connect and mount up without an externally powered hub, though they are very generic drives, one is a 512M and one is a 1G, I got both of them for free from workshops I have attended. Below is a dump of what I see when plugging in and then mounting the 1G drive.

    [root@OMAP3EVM /]# musb_stage0_irq 699: CONNECT (a_host) devctl 5d
    usb 1-1: new high speed USB device using musb_hdrc and address 2
    usb 1-1: Product: Flash Disk
    usb 1-1: Manufacturer: 2.0
    usb 1-1: SerialNumber: 259762356401
    usb 1-1: configuration #1 chosen from 1 choice
    scsi0 : SCSI emulation for USB Mass Storage devices
    scsi 0:0:0:0: Direct-Access     2.0      Flash Disk       4.00 PQ: 0 ANSI: 2
    sd 0:0:0:0: [sda] 2068991 512-byte hardware sectors (1059 MB)
    sd 0:0:0:0: [sda] Write Protect is off
    sd 0:0:0:0: [sda] Assuming drive cache: write through
    sd 0:0:0:0: [sda] 2068991 512-byte hardware sectors (1059 MB)
    sd 0:0:0:0: [sda] Write Protect is off
    sd 0:0:0:0: [sda] Assuming drive cache: write through
     sda: sda1
    sd 0:0:0:0: [sda] Attached SCSI removable disk

    [root@OMAP3EVM /]# mount /dev/sda1 /mnt/flashdrive/
    [root@OMAP3EVM /]# cd /mnt/flashdrive/

    I did find that if I disconnected and tried to reconnect that disconnecting was causing some failure that prevented the drive from being connected again (either USB drive for that matter, output seen below), this did not happen when using the powered hub, though if the hub itself was disconnected from the board it would no longer connect either. The board I tried this on is booting an older SDK version though, I did not have a chance to update it to the newer SDK yet.

    [root@OMAP3EVM /mnt]# umount /dev/sda1
    [root@OMAP3EVM /mnt]# musb_stage2_irq 796: DISCONNECT (a_host) as Host, devctl 1
    9
    usb 1-1: USB disconnect, address 2
    musb_otg_timer_func 304: No response from B-device

  • Your result is similar to my working drive (the Kingston), except that mine seems to require an extra try.  The errors that I see that you don't in your testing are...

    musb_stage0_irq 638: VBUS_ERROR in a_idle (91, <VBusValid), retry #1, port1 00000100 (twice)

    The second time seems to be in the middle of an "sda" access, implying that the sda device has been created.  But the VBUS_ERROR appears to lead to another error...

    end_request: I/O error, dev sda, sector 0

    Then everything appears to start over and works fine the second time.

    Yes, I have the same result as you upon disconnect/re-connect.

     

    So any clues as to the VBUS_ERROR?  Also, I hope Swami is wrong about drive current being a limitation - any comments on his response?

    Also, any ideas on the "[sda] READ CAPACITY failed" message occurring during the Lexar enumeration?

    Thanks.

     

  • I am not very familiar with the errors, but I can say that Swami is probably right as to the power limitation, since VBUS refers to the 5v power line being provided by the USB port. I would guess that with the VBUS error that the read capacity error is related, because if the VBUS voltage is dropping too low than the USB stick may not behave properly. If possible I would suggest trying out a powered hub to see if that allows you to connect up the USB sticks properly, at least as a test as there is not much else to configure in regards to the USB port.

  • I'll explore using a powered hub.  However, this leads to another question - can the current drive be increased?  Otherwise it seems as though any OMAP35x design will have potential issues supporting simple USB devices.  Doesn't the USB specification require a minimum of 100mA of current to be supplied to a USB device?  Am I missing something?

     

  • swami,

    Is your suggestion to try a powered hub based on knowledge that the OMAP35x EVM specifically has a USB drive current deficiency?  I feel certain that connecting a powered hub would resolve the problem, but I can't expect to require customers to have a powered hub installed before using certain USB thumb drives on our product.  Can you add some detail to your suggestion?

    Thanks.

     

  • The USB spec does specify 500mA but I am not sure if that applies to USB OTG implementations like this, I have not done much digging into the EVM schematics to determine its theoretical maximum current but I can say that if it uses the same USB setup as the Beagle Board than it is significantly less current than many USB devices would expect, something around 100mA I believe. This is an implementation specific issue though, you would just have to design the USB power setup on your board to provide more current on the 5v VBUS line. In theory you coule even have a seperate 5v supply on the board to power the VBUS line, essentially building the powered part of the powered USB hub into your board.

  • OMAP35xx EVM has power constraint and thus self powered hub is required. Apart from this whenever any connected device is removed from EVM bus power is switched-off after 1.1sec as per OTG specs. This is the reason why after disconnect devices doesn't get recognised/configured on the EVM. Before reconnecting we need to switch-on the power using $ echo "F" > proc/driver/musb_hdrc