I made this mistake in my very first USB implementation, so I remember this 
well. 

 

This is easier to show with pictures, but as I recall text rules on this 
mailing list.  The sequence of tokens is for a control transfer with a DATA-OUT 
phase is :

 

1) Setup phase:

Host>                    SETUP

Device>                ACK or silent – STALL is not legal; and silence counts 
for the 3-strike rule.

 

2) Data phase: a sequence of one or more of the following:

Host>                    OUT/DATA(payload)

Device>                ACK / NAK / STALL

 

3) Status phase NAKs (optional, at device’s option) or error (“STALL”) response:

Host>                    IN

Device>                NAK / STALL

 

4) Status phase completion:

Host>                    IN

Device>                ZLP (zero-length data packet)

Host>                    ACK or no-response

 

To further complicate things, the host is permitted to abandon a control 
transfer at any point, by simply sending a new SETUP. The device is required to 
tolerate this. The device must not fail.  This essentially only happens in 
stress testing (and, if you’ve not tested for it, after you have shipped a 
large number of devices…. Murphy at work).

 

So: the device is allowed to return STALL during the data phase or during the 
status phase.

 

Hence my original comment “you can’t NAK a SETUP packet”.  Some hardware will 
do it, but most host controllers choke, and it’s a protocol violation.

 

Best regards,

--Terry

 

From: [email protected] 
[mailto:[email protected]] On Behalf Of Paul Stoffregen
Sent: Monday, March 23, 2015 15:09
To: [email protected]
Subject: Re: Yosemite USB CDC ACM

 

On 03/20/2015 10:27 AM, Terry Moore wrote:

Your device can’t NAK setup packets; that’s not defined behavior in the USB 
spec.  Your device can either ACK (in which case the host begins the data or 
status phase, as appropriate) or be completely silent.


Aren't you supposed to stall endpoint 0 if you can't respond with ACK?  That's 
different being being completely silent, right?

I mean, in general for control transfers.  I'm pretty sure CDC ACM protocol 
requires a non-stall response on SET_LINE_CODING.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/usb/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to