Hi Christophe, Christophe Coutand wrote:
> The AT91 USB driver is sending an empty packet at the end of a data > transfer (transfer from device to host) if the last fragment of the > packet is exactly equal to the endpoint size. Is this part of the USB > specification? The basic USB spec doesn't define this one way or another. Whether or not bulk transfers use this kind of zero length packet termination depends on the class driver specification. Typically, comms-style class drivers will use zero length packet termination because it is not possible to know in advance how much data will be transferred for variable length packets, etc. > In my case, this is triggering a reset from the host > (both Linux or Win). Not sending the empty packet fixes the problem. The > transfer is 512 bytes sent in two USB data packet. > > As anyone experienced such an issue? I'm not familiar with the bulk storage class drivers, but from what you're saying it sounds as though they do not use zero length packet termination. With the STM32 USB driver I added a CDL option to turn zero length packet termination on and off for the entire USB device. This may not be the most flexible approach, but it should be adequate for most applications. Chris. -- Christopher J. Holgate Thinking Of The Future @ Zynaptic Limited (www.zynaptic.com) -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss