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.

Trouble receiving large USB data blocks



Good Morning!

I am trying to use the Starterware USB stack in a AM335x application.  The stack enumerates properly and can exchange Endpoint 0 data with the Windows driver. I am having a problem getting a large block, about 4k, of data into my application via a bulk pipe.  I see the USB_EVENT_RX_AVAILABLE event in my RxHandler callback.  I use this to send an event to my USB task.  The task handles the event in it's own context by :

USBBufferDataAvailable() to check the data count,

USBBufferRead() to get the data.

This works for the first packet received, but I then do not get any more USB_EVENT_RX_AVAILABLE events and the transaction hangs.

From what I read in the documentation, once I read the data buffer, the SOF timer will ack the data so I can get the next packet.

I think I am missing something basic in my understanding of how the stack works.  Any idea what?

Gerry Belanger

  • Problem solved.

    I was confused by all the different callbacks and handlers, and how they were related.

    I realized that the buffer module is hooked into the class driver callback, and I was really using the buffer module's callback.  So I used that to send an event to the task needing the usb data.  That task then checked how much buffer data was available, then read that amount from the buffer, parsed it, and looped until the buffer was empty.  The next callback kicks the event again, causing the destination task to wake and continue it's operation.

    Gerry Belanger