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.

TM4C129CNCPDT: USB bulk device stall

Part Number: TM4C129CNCPDT

Hi,

I am using TI's usblib to create a bulk usb device. Occasionally the host issues a USB_URB IN, and the device responds with EPIPE. As far as I can tell this means the device has stalled. I added a global variable to usblib and driverlib to my application to try and track down what condition is triggering the stall, but sadly my variable is never touched. I'm assuming this means the stall is happening someplace else, in a manner I don't understand.

Can someone point me at the places in the library where a stall can happen?

Thank you,

Lance

  • Hello Lance,

    I am not sure about all the places where a STALL can occur. Are you seeing the USB commands you mentioned via using a USB Analyzer? If so, you should be able to track down which function is receiving the packet that triggers the stall and then trace through the USBlib that way.

    If you can re-create the issue using TI LaunchPad to where I can duplicate it at my own desk I could try and assist with such a search but as you've noticed the USBlib is quite large so it's just not something where I can say 'oh that can only happen if you go here...' without hardware to work with and debug with.
  • I am using tcpdump on a linux host as a usb analyzer, and see a URB_BULK in from the host to the device, followed by an URB_BULK in from the device to the host with the EPIPE error set.

    I have grepped the library for Stall assuming that's how the stall occurs, but some other codepath must be happening. Or does the stall happen in hardware? Or should I look for some other thing? I don't mind if there are lots of places to search for, as long as I know what to search for.

    I don't have Launchpad.

    Thank you,
    Lance
  • Hello Lance,

    I don't have any experience with dealing with a USB Stall yet, but I found this past E2E thread which goes into the topic in quite a lot of detail including some posts about how to debug some of this in TivaWare. Can you please look through it and see if that gets you further along the process? If you have additional questions based on the thread I will try and help answer them.

    TivaWare and USB Stall: https://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/477350

    Edit: Updated thread link to be first page of E2E post

  • Thanks for that link. I've already added a global in that part of the library to see if that is where the stall is happening, but my global doesn't get touched.

    I was pretty sure it wasn't going to happen there because that thread deals with endpoint 0 during enumeration. My stall occurs much later after many reads have successfully happened. But I still added the global there for completeness in my search to determine what is going on.

    I've also added a global to driverlib/usb.c USBDevEndpointStall() to see if anything was calling that, but I never got a hit there either. Are there other functions which put the device in the stall state?

    Thank you,
    -Lance
  • Hi Lance,

    I would look into areas of the UsbLib that refer to Stall in any manner. You may need to manually add the UsbLib files rather than use the usblib.a library so you can get into these API's while debugging.

    I don't know enough about the UsbLib (did not take part in it's design at all) to just list off specific files to look at for this stall issue, nor do I know enough about which of the many UsbLib files you are using for your project where a search could be done through.

    As far as how to look through UsbLib... I find Windows is quite useful when it comes to searching keywords through code file libraries. So for example I would just go to [Install Path]\TivaWare_C_Series-2.1.4.178\usblib and type in keywords such as 'Stall' into the search and then find which files are relevant to my application and review them.

  • Hmm. I've already searched for stall and haven't had much luck in finding the culprit. More debug will be ongoing, but if anyone has enough experience with usblib to point me in the right direction, I'd appreciate it.

    Thank you,
    -Lance