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.

USB0 in TMS320C6748, STALL was recived

Other Parts Discussed in Thread: OMAPL138

OMAP L138 EVM      with   TMS320C6748 SOM-M1.

I write simple test (in C)  for work with USB0 controller in TMS320C6748. Code is running on OMAPL138 EVM board (Logic PD).

Now I used INTSRCR register from USB0 controller to work with USB0 interrupts.

In my program USB controller work on full speed,  My simple test read (or write) LBA=0 block  from usb flash drive.

If it work with A-Data flash drive, all is OK.

I read descriptor, set address1, set config 1, set interface 1, send SCSI read10 command and read 512 (8*64) bytes from LBA=0.

 But if I use another flash drive (ALTV for example), than I recive STALL when I send REQPKT to device (after read10 command).

Why? Where is my mistake?

- Alex.

 

  • Let me make sure that I understand the problem.  You were able to get the first flash drive to work well with your current USB code.  However, when you use a second flash drive with the same code, you get a RXSTALL error? 

    Out of curiosity, have you tried the BIOSUSB software offering?  It seems like you are implementing a MSC (mass storage class) driver, and the BIOSUSB already has pre-built drivers for that.  Here is the link for more information about BIOSUSB: http://software-dl.ti.com/dsps/dsps_public_sw/psp/BIOSUSB/index.html

    --Christina

  • Alex,

    Depending on the drive capabality some drives might not support all scsi commands.  If so they would respond with a stall.

    Pl. refer to the MSC spec to see how to recover from such a situation.

    I would recommned you to use BIOSUSB stack for this purpose as it already supports working with USB sticks

     

    regards

    swami

  • Christina,

    thanks for your answer.

    BIOSUSB package don't include source code and I don't use DSP BIOS.

    My test programm is the same, but it change In/Out number for endpoints of  current  Flash drive.  Endpoint Number  was readed from Endpoint Descriptor.

     

     I send INQUIRY command,  it work with A-Data flash drive and don't work with ALTV flash drive.

    I recive from A-Data flash drive this data:

    0x02028000                       
                        ^--------- PDT= 0   SBC-2  (read10)
                  ^------------   removeble media
              ^-------------      2  SPC-0 ???   (inquiry)
           ^---------------      2   (must be 2)
     0x0000001F           ???? must be  0x20 (0x24 - 4)
     0x........                     T10 vendor   

    ........        ...........

     

    If I send INQUIRY command for  ALTV flash drive than  I recive STALL.

    But ALTV flash drive work in Windows. I can see that it correct work with read10 and INQUIRY command.

    For example, response ALTV flash drive for INQUIRY command  (in Windows):

     0x01008000
                          ^--------- PDT= 0    SBC-2  (read10)
                  ^------------     removeble media
               ^-------------      0  SPC-?
            ^---------------       1   (must be 2)
     0x0000001F              ???? must be  0x20 (0x24 - 4)

      ........          .........

    I use INTSRCR register from USB0 controller in polling mode. I don't used event 19 flag for recive interrupts.

    Where is my mistake?

    -- Alex.

     

  • The version and RDF (response data format) fields are different between the two devices, so it might be a device related issue.  Have you tried a third USB flash drive?

    --Christina

  • Christina,

    thanks for your answer.

    On One flash I recive also STALL  (Transcend). On another flash I recive NAKLIMIT eror.

    1. I don't use state mashine in my test programm and don't use event 19 interrupt to work with device. But different devices may have different time-out to correct work. For device with one time-out  my test work correct, for device with another time out my test don't work. Is it reason?

    2. May be some tips and tricks to work with usb mass storage class device?

    What you can say about it.

    --Alex.

     

  • So the A-data flash drive is the only device that has worked so far?  What type of USB transaction are you performing?  If it is a control transaction, are you performing all the steps required for a control transaction (e.g., setup command, data phase, status phase)?

    I know you aren't using BIOS, but is there a reason why it's not a viable option?  The BIOSUSB will be an easier solution than writing the code from scratch because it already has drivers ready for MSC.  It also has examples on how to use the BIOSUSB.

    --Christina

  • Christina,

    thanks for your answer.

    My test program work correct  with end-point 0  for all devices (all flash drives that I have). I can read all descriptos, may set address and so on.

    I have problem with SCSI command in bulk mode. I send SCSI command read10 (in CBW) and recive ACK. Than I send REQPRT to read data from device.      

    If I used A-Data 2Gb flash all is OK - I recive data and than recive CSW.   If I use Transend 2Gb  flash I recive STALL. If I used A-Data 4Gb flash I recive NAKLIMIT error.

    The same problem and with INQUIRY command. For example, after INQUIRY command I recive CSW (code 0 - OK) insted of data from Kingston flash.

     

    I must have source code for my programm. My programm must read/write block of data only.  I not need all USB stack.

    --Alex.

     

     

     

  • My expertise is limited to the hardware and functional part of the USB controller.  I'm not too familiar with the different classes and software drivers.

    You can probably look at the state machine in the USB MSC spec to understand what is happening and how to resolve the STALL issue.  Here is a link: http://www.usb.org/developers/devclass_docs/usbmassbulk_10.pdf

    Our two main software offerings are BIOSUSB and Linux, which has MSC and HID class drivers.  If you want to create a custom USB class that is not offered by our software packages, then you can engage with a third party (i.e., Mistral) who are familiar with our USB controller.  If you need more assistance, I would recommend contacting your local sales or FAE office for direct support. 

    --Christina

  • Christina,

    thanks, I understand your answer.

    -- Alex.

     

  • I want to add some words about my problem.

    After programm was recived STALL,

    than programm do BOSMR, Cleaer Feature end-point 1,2  and send CBW with read10 command.

    But device  send STALL again.

    May anybody help me? Where is my mistake?

    -- Alex.