This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: AT91 USB driver sending empty packet


Hi Chris,

Thank you for clarifying that for me. I could not yet find any info
about the expected behavior of the bulk storage class drivers to empty
packet. I found that empty packet can be used in some specific cases but
nothing about termination of a regular data transfer phase. I think I
will implement what you have suggested and post a patch. Sending empty
packet should still be possible from the application layer therefore
should be acceptable.

Christophe 


-----Original Message-----
From: Chris Holgate [mailto:chris@zynaptic.com] 
Sent: 28. juni 2010 23:44
To: Christophe Coutand
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] AT91 USB driver sending empty packet

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]