FX3/CX3/FX3S: Checking the stall status of a USB consumer socket – KBA233264
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Version: **
Normally, you can track the producer and consumer events in the DMA callback to verify that the consumer socket has no data in the queue and all committed buffers are consumed. If it is not possible to use this method, use the following alternative to verify that the consumer socket has no data in the queue and all the committed buffers are consumed.
Use this method when a certain amount of DMA transfers is completed, and no more producer events are expected. At this point, the consumer socket will be in stall state. The socket will be in stall state when it is waiting for data to be loaded into the Fetch Queue or waiting for an event. See sections 5.5.5 and 5.5.7 of EZ-USB FX3 Technical Reference Manual for more details.
Use the following code snippet to check to check for the stall status:
Note that it may not be a good idea to check for the stall status while a DMA transfer is ongoing because if the rate at which data is produced is significantly less than the rate at which the data is consumed, the socket goes to the stall state, waiting for more data.