Menu

#11 IN write buffer trashed

open
nobody
None
5
2007-12-14
2007-12-14
Anonymous
No

Not too sure if this is a bug or not.

In the function USBHandleControlTransfer IN data is sent to the PC in the
else if (bEP == 0x80) { ...
block. For some (at this stage unknown) reason USBHandleControlTransfer is executed requesting IN data before a previous IN data has been sent. Consequently there is still data in the IN write buffer when USBHandleControlTransfer is executed the second time. This means that the IN write buffer is overwritten by a zero length packet before the first data is sent. This crashes my PC application by creating a stall on the endpoint.

I inserted the following line
if (!(bEPStat & EP_STATUS_DATA))
before the call to DataIn() which gives the data a chance to send.

This seemed to fix the problem. Does this sound right you you guys?

Regards, James Brown
Data Acquisition

Discussion


Log in to post a comment.