-
Notifications
You must be signed in to change notification settings - Fork 1.7k
USB
The STALL packet indicates that the endpoint has halted, or a control pipe does not support a certain request.
The host must never issue a STALL handshake packet.
p.225 of USB Rev 2.0
8.5.3
When a STALL handshake is sent by a control endpoint in either the Data or Status stages of a control transfer, a STALL handshake must be returned on all succeeding accesses to that endpoint until a SETUP PID is received. The endpoint is not required to return a STALL handshake after it receives a subsequent SETUP PID. For the default endpoint, if an ACK handshake is returned for the SETUP transaction, the host expects that the endpoint has automatically recovered from the condition that caused the STALL and the endpoint must operate normally.
8.5.3.4
Control pipes have the unique ability to return a STALL handshake due to function problems in control transfers. If the device is unable to complete a command, it returns a STALL in the Data and/or Status stages of the control transfer. Unlike the case of a functional stall, protocol stall does not indicate an error with the device. The protocol STALL condition lasts until the receipt of the next SETUP transaction, and the function will return STALL in response to any IN or OUT transaction on the pipe until the SETUP transaction is received. In general, protocol stall indicates that the request or its parameters are not understood by the device and thus provides a mechanism for extending USB requests. A control pipe may also support functional stall as well, but this is not recommended. This is a degenerative case, because a functional stall on a control pipe indicates that it has lost the ability to communicate with the host. If the control pipe does support functional stall, then it must possess a Halt feature, which can be set or cleared by the host. Chapter 9 details how to treat the special case of a Halt feature on a control pipe. A well-designed device will associate all of its functions and Halt features with non-control endpoints. The control pipes should be reserved for servicing USB requests.