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.

RTOS/AM3359: Issue with USB thumb drive

Part Number: AM3359

Tool/software: TI-RTOS

Hello,

Working on a design where have support for a thumb drive to be used.   Everything has been going good working with different thumb drives, until I came across a new thumb drive.  When inserting this stick, it seems like it takes a lot longer for the drive to even be recognized, but after it is recognized,  Get the MSCCallback with event of opened.   The system them becomes very unresponsive.  Sometimes the system will mount the filesystem. (Fat32 4GB).  But any access to the stick causes the system to  reboot. (Have watch dog, so that is causing the reboot).

Now have not had any problem with any other thumb drives tested.

Looking at the thumb drive, the only thing different between this and thumb drives that work is that, this one has both bEndpointAddress the same at 1.  (Using lsub to look at information).

      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0

Verses one that works:

      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval             255
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval             255

(bInterval seems to be either 0 or 255, other thumb drives work also when bInterval is 0).

Now it looks like the one that is not working, does not have a valid USB vendor, so not sure if it is Compliance Tested.  But from my reading having the Bulk endpoints being the same is allowed.

Any suggestions?

Thanks

Robert

  • Hi,

    You mentioned "lusb". What is the test environment? Is it the TI Processor SDK RTOS AM335x USB MSC host example? Or AM335x runs the Linux? What release? And what is the name of the failure USB thumb drive?

    Regards, Eric
  • I used "lsusb -v" under linux to get the information about the drive. I looked at other drives and they all have different bEndPointAddress (1 & 2) verses this drive uses the same bEndPointAddress (1 & 1)

    Using TI-RTos, pdk_am335_1_0_5. The test is with our software that uses USB MSC host example as a starting point.

    Don't know the manufacturer of the thumb drive, as the id is just 0xABCD, so who ever is making these did not get a USB-IF ID.

    Robert
  • Hi,

    We are looking at the USB RTOS driver code and will let you know.

    Regards, Eric
  • Hi,

    We looked code and didn't see any issue also we did below test with pdk_am335x_1_0_14:

    1. Ran original USB_DevMsc_evmAM335x_armExampleProject test to make sure it works with a Windows PC.
    2. Ran the modified USB_DevMsc_evmAM335x_armExampleProjec (pdk_am335x_1_0_14\packages\ti\drv\usb\src\usb_func\device\usbdmsc.c file, changed DATA_OUT_ENDPOINT to 1, same as DATA_IN_ENDPOINT, rebuild the USB library, then test application) to make sure it also with a Windows PC
    3. Ran the original USB_HostMsc_evmAM335x_armExampleProject to make sure it can enumerate a commercial USB stick

    Finally, we used two AM335x EVMs connected together via USB. On side run 3, the other side run 2. The MSC host can also enumerate the modified MSC dev with (EP IN=1/OUT=1). So using same IN/OUT shouldn’t be a problem when talking to an AM335x USB host .

    The USB device you used may have other compliance issues.

    Regards, Eric
  • Thank you for the support.  I will look to see if I can update to the latest versions of the AM335x Processor Libraries. Looking at the difference between the 1_0_14 (newest) and 1_0_5 (Currently using) of the pdk libraries, I see differences.

    Thanks

    Robert

    P.S. Any way I can send you a USB stick that I see the issue on, and can check if you see the same issue?   (It would not have to be returned).

  • Robert,

    Do you have the USB stick model name, Internet link we can purchase? We can't take customer shipment, sorry for this.

    Regards, Eric
  • Eric,

    We purchase them from OEX.  Here is a link to the website:

    promo.oexusa.com/:quicksearch.htm

    (Item # LAEFB-HJCTJ)

    Not sure that you can order just 1, that is why I just wanted to send you one.

    Robert

  • Hi Robert,

    It is wholeslaes, I can't buy a few from them. I am checking internally how to proceed and let you know. Meanwhile, can you confirm the behavior of this USB stick with:

    • A typical Windows/Linux PC ====> no enumeration, mount issue? 
    • TI AM335x as USB host running Linux =====>?
    • TI AM335x as USB host running RTOS======>takes a lot longer for the drive to even be recognized, very unresponsive. Sometimes the system will mount the filesystem. (Fat32 4GB).  But any access to the stick causes the system to reboot.

    Also, do you have the ability to collect the trace with a USB analyzer?

    Regards, Eric

    • A typical Windows/Linux PC ====> Have not seen any, but others have noted sometimes files are not copied correctly.
    • TI AM335x as USB host running Linux =====> Tried it on a BeagleBone GREEN.  Below is a dmsg dump, seems like having problems, where the drive went away.
    • TI AM335x as USB host running RTOS======>takes a lot longer for the drive to even be recognized, very unresponsive. Sometimes the system will mount the filesystem. (Fat32 4GB).  But any access to the stick causes the system to reboot.

    Also, do you have the ability to collect the trace with a USB analyzer?  Do not have a USB analyzer.

    Robert

    60.477190] usb 1-1: new high-speed USB device number 4 using musb-hdrc
    [   60.617969] usb 1-1: New USB device found, idVendor=abcd, idProduct=1234
    [   60.618025] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [   60.618057] usb 1-1: Product: UDisk           
    [   60.618086] usb 1-1: Manufacturer: General
    [   60.618114] usb 1-1: SerialNumber: �Љ
    [   60.723978] usb-storage 1-1:1.0: USB Mass Storage device detected
    [   60.731308] scsi host0: usb-storage 1-1:1.0
    [   60.732722] usbcore: registered new interface driver usb-storage
    [   60.742704] usbcore: registered new interface driver uas
    [   61.728454] scsi 0:0:0:0: Direct-Access     General  UDisk            5.00 PQ: 0 ANSI: 2
    [   61.732017] sd 0:0:0:0: [sda] 3893248 512-byte logical blocks: (1.99 GB/1.86 GiB)
    [   61.732449] sd 0:0:0:0: [sda] Write Protect is off
    [   61.732493] sd 0:0:0:0: [sda] Mode Sense: 0b 00 00 08
    [   61.732907] sd 0:0:0:0: [sda] No Caching mode page found
    [   61.738484] sd 0:0:0:0: [sda] Assuming drive cache: write through
    [   61.812694]  sda:
    [   61.816444] sd 0:0:0:0: [sda] Attached SCSI removable disk
    [   61.824794] sd 0:0:0:0: Attached scsi generic sg0 type 0
    [   63.299033] usb 1-1: USB disconnect, device number 4
    [   63.717110] usb 1-1: new high-speed USB device number 5 using musb-hdrc
    [   78.837152] usb 1-1: device descriptor read/64, error -110
    [   79.088078] usb 1-1: New USB device found, idVendor=abcd, idProduct=1234
    [   79.088133] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [   79.088166] usb 1-1: Product: UDisk           
    [   79.088196] usb 1-1: Manufacturer: General
    [   79.088224] usb 1-1: SerialNumber: �Љ
    [   79.090527] usb-storage 1-1:1.0: USB Mass Storage device detected
    [   79.097577] scsi host1: usb-storage 1-1:1.0
    [   80.098611] scsi 1:0:0:0: Direct-Access     General  UDisk            5.00 PQ: 0 ANSI: 2
    [   80.102178] sd 1:0:0:0: [sda] 3893248 512-byte logical blocks: (1.99 GB/1.86 GiB)
    [   80.102626] sd 1:0:0:0: [sda] Write Protect is off
    [   80.102670] sd 1:0:0:0: [sda] Mode Sense: 0b 00 00 08
    [   80.103184] sd 1:0:0:0: [sda] No Caching mode page found
    [   80.108781] sd 1:0:0:0: [sda] Assuming drive cache: write through
    [   80.119516] sd 1:0:0:0: Attached scsi generic sg0 type 0
    [   80.182896]  sda:
    [   80.186707] sd 1:0:0:0: [sda] Attached SCSI removable disk
    [  222.521348] usb 1-1: USB disconnect, device number 5
    [  222.927062] usb 1-1: new high-speed USB device number 6 using musb-hdrc
    [  238.047134] usb 1-1: device descriptor read/64, error -110
    [  238.297839] usb 1-1: New USB device found, idVendor=abcd, idProduct=1234
    [  238.297894] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  238.297925] usb 1-1: Product: UDisk           
    [  238.297954] usb 1-1: Manufacturer: General
    [  238.297981] usb 1-1: SerialNumber: �Љ
    [  238.303535] usb-storage 1-1:1.0: USB Mass Storage device detected
    [  238.317404] scsi host2: usb-storage 1-1:1.0
    [  239.318404] scsi 2:0:0:0: Direct-Access     General  UDisk            5.00 PQ: 0 ANSI: 2
    [  239.321788] sd 2:0:0:0: [sda] 3893248 512-byte logical blocks: (1.99 GB/1.86 GiB)
    [  239.322334] sd 2:0:0:0: [sda] Write Protect is off
    [  239.322379] sd 2:0:0:0: [sda] Mode Sense: 0b 00 00 08
    [  239.322797] sd 2:0:0:0: [sda] No Caching mode page found
    [  239.328370] sd 2:0:0:0: [sda] Assuming drive cache: write through
    [  239.337581] sd 2:0:0:0: Attached scsi generic sg0 type 0
    [  239.402614]  sda:
    [  239.404921] sd 2:0:0:0: [sda] Attached SCSI removable disk
    [  296.121472] FAT-fs (sda): Volume was not properly unmounted. Some data may be corrupt. Please run .
    [ 1673.314834] usb 1-1: USB disconnect, device number 6
    [ 1673.727042] usb 1-1: new high-speed USB device number 7 using musb-hdrc
    [ 1688.847114] usb 1-1: device descriptor read/64, error -110
    [ 1689.097963] usb 1-1: New USB device found, idVendor=abcd, idProduct=1234
    [ 1689.098016] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 1689.098049] usb 1-1: Product: UDisk           
    [ 1689.098077] usb 1-1: Manufacturer: General
    [ 1689.098105] usb 1-1: SerialNumber: �Љ
    [ 1689.108258] usb-storage 1-1:1.0: USB Mass Storage device detected
    [ 1689.117444] scsi host3: usb-storage 1-1:1.0
    [ 1690.118469] scsi 3:0:0:0: Direct-Access     General  UDisk            5.00 PQ: 0 ANSI: 2
    [ 1690.124004] sd 3:0:0:0: Attached scsi generic sg0 type 0
    [ 1690.125638] sd 3:0:0:0: [sdb] 3893248 512-byte logical blocks: (1.99 GB/1.86 GiB)
    [ 1690.126070] sd 3:0:0:0: [sdb] Write Protect is off
    [ 1690.126115] sd 3:0:0:0: [sdb] Mode Sense: 0b 00 00 08
    [ 1690.126578] sd 3:0:0:0: [sdb] No Caching mode page found
    [ 1690.132155] sd 3:0:0:0: [sdb] Assuming drive cache: write through
    [ 1690.210262]  sdb:
    [ 1690.214080] sd 3:0:0:0: [sdb] Attached SCSI removable disk
    [ 4976.684848] FAT-fs (sda): Directory bread(block 65536) failed
    [ 4982.973036] FAT-fs (sda): Directory bread(block 65536) failed
    [ 4984.351751] FAT-fs (sda): Directory bread(block 65536) failed

  • Hi Robert,

    Thanks for the additional test and info. Let me discuss internally how do we want to proceed and get back to you.

    Regards, Eric

  • Robert,

    In the Linux log:

    [ 1673.314834] usb 1-1: USB disconnect, device number 6
    [ 1673.727042] usb 1-1: new high-speed USB device number 7 using musb-hdrc
    [ 1688.847114] usb 1-1: device descriptor read/64, error -110

    In this case the USB host AM335x EVM can’t read the device descriptor from the USB device.  But it was able to read the string descriptors and do all the SCSI commands later on.  The Directory block read problem could be just the drive problem. 

    The files not copied correctly using a Linux PC problem could be due to or similar to these traces:

    [ 4976.684848] FAT-fs (sda): Directory bread(block 65536) failed
    [ 4982.973036] FAT-fs (sda): Directory bread(block 65536) failed
    [ 4984.351751] FAT-fs (sda): Directory bread(block 65536) failed

    The drive doesn’t look good with all bad ID.

    [ 1689.097963] usb 1-1: New USB device found, idVendor=abcd, idProduct=1234
    [ 1689.098016] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3

    We have tried to keep our Linux and RTOS USB host driver robust and didn't get failure issue like this before. We will not continue debug this faulty USB drive. Sorry for this!

    Regards, Eric