2005-12-21 08:36 PM
Double Buffered Bulk In Transfer, problem.
2005-12-12 07:57 PM
Hi,
I am trying to write an application, that is capeable of transfering bulk packets of different sizes. The problem is that if I transfers an uneven number of packets (64 bytes) f.i. 7 packets, then the first transfer is ok, the next seems to be ok, but actualy 8 packets is transferred, and the 3rd packet isn't succesfull because the header is copied to the wrong buffer. Has anyone made anything for Bulk In transfer, that is working with different transfer sizes? Best regards, Frank Andersen PS. I have attached my usb_endp.c file ________________ Attachments : usb_endp.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtDa&d=%2Fa%2F0X0000000aKP%2FwPuLGE8c_uvLGyeswW.hxJSyIogjX3ghcc9DzzrxlFc&asPdf=false2005-12-21 12:43 AM
Is there any one out there, working on this topic?
Best regards Frank Andersen2005-12-21 08:36 PM
Maybe its not the amount of pakets, but the paket size. In the last line of this function ther should be an <= instead of ==.
if(wNTrasf <= 0) return; Hope this helps. void UserToPMABufferCopy(BYTE *pbUsrBuf,WORD wPMABufAddr, WORD wNBytes) { BYTE *pbVal; WORD wVal; DWORD *pdwVal; int wNTrasf=wNBytes; if((wNBytes) == 0) return; pdwVal = (DWORD *)(wPMABufAddr*2 + PMAAddr); while(USB_TRUE) { wVal = 0; pbVal = (BYTE *)&wVal; if((wNTrasf--) > 0) { *pbVal++ = *pbUsrBuf++; if((wNTrasf--) > 0) { *pbVal++ = *pbUsrBuf++; } } *pdwVal++ = (DWORD)wVal; if(wNTrasf <= 0) return; }/* while *null