cancel
Showing results for 
Search instead for 
Did you mean: 

USB random transmit failure in bulk transfer.

sanjeevk
Associate II
Posted on May 03, 2007 at 21:41

USB random transmit failure in bulk transfer.

2 REPLIES 2
sanjeevk
Associate II
Posted on May 17, 2011 at 09:42

Set-up:

We use STR9 eval board(STR912-SK) along with STR91x USB firmware library with Virtual Com Port example by modifying the usb_desc.c file to fit our requirement of one Bulk IN and one Bulk OUT endpoints. Please find the attached usb_desc.c for our changes. We use Jungo's(http://www.jungo.com/support/support_windriver.html) Windriver USB driver wizard for generating the PC device drivers and have developed a custom PC application to support data transfers on top of that. We use HHD software's USB_mon for monitoring USB traffic.(http://www.hhdsoftware.com/Products/home/usb-monitor.html)

Problem details:

We receive 260 bytes of data( 5 bulk OUT transfers) and send a response(typically < 64 bytes, one bulk IN transfer) to PC. The problem is the bulk IN transfer fails randomly( once in 25-50 transfers). We have verified that the necessary functions( viz. UserToPMABufferCopy(pTxBuf, ENDP1_TXADDR, nBytes); SetEPTxCount(ENDP1,nBytes); SetEPTxValid(ENDP1);) are executing, but still we dont see any data on the USB when we see on the logger. The typical transfer rate is 5 bulk OUT transfers + one bulk IN transfer every 1.5 seconds. We have enabled the watch dog timer interrupt(@ 250uS) along with USB interrupts.

I request a quick support on this and if you need more inputs and/or any tests to be done on the set-up please let me know

lanz
Associate
Posted on May 17, 2011 at 09:42

I try adapt virtual comm via USB to multiple comm implementation - four or five bidirectional virtual comm interfaces in one USB device. I am testing the implementatin on ARM9 - STR912FW44X6 (serie 619) on STR910-EVAL board. I detected rarely OUT packed losses, if I use the same endpoint number for reception and for transmission. If I use different endpoint for IN and OUT, I not detect any packed losses.

I assume, the OUT packet losses may be caused by lose of received OUT packed size stored in bites 25:16 of USB_COUNT register in case of writing new IN packed size to bites 9:0 of the register by macro _SetEPTxCount(). The USB_COUNT register modification can not be atomic and any new value in bites 25:16 of the register (item COUNTn_RN=X[9:0]) writen by USB interface may be lost due to colision with _SetEPTxCount(). I suspect, design of the USB interface causes imposibility of atomic change of COUNTn_TX without interference of COUNTn_RX bits of USB_COUNT register. I recomend using of different endpoint numbers for IN and for OUT direction (but number of usable endpoints is decreased, of course).

Libor Seidl (seidl@feld.cvut.cz)