Information Technology Reference
In-Depth Information
// Service USB interrupts. (See Microchip's Framework firmware for details.)
USBDriverService();
} // End received CBW.
}
More about STALL
The mass-storage class is unique in its use of the STALL handshake to end
bulk transfers. In other USB classes, a sender can indicate the end of a trans-
fer by transmitting a short packet, which is a data packet that contains zero
data bytes or any quantity fewer than wMaxPacketSize. In contrast,
mass-storage devices use STALL for this purpose and to respond to other
error conditions.
After a bulk endpoint returns STALL, the endpoint is in the halt condition.
To resume communications with the endpoint, the host must issue a Clear
Feature(ENDPOINT_HALT) control request with the endpoint's address
in the Setup transaction's wIndex field.
(Endpoint zero can also use the STALL handshake. On receiving a Get Max
LUN request, a device with a single LUN may return a STALL to indicate
that the device doesn't support the command. The endpoint resumes nor-
mal operation on receiving a new Setup transaction.)
A mass-storage device must stall one or both bulk endpoints in these situa-
tions:
If a device sends less than the requested amount of data in the data-trans-
port phase, the device must stall the bulk IN endpoint.
If a received CBW isn't valid, the device must stall the bulk IN endpoint
and must either stall the bulk OUT endpoint or accept and discard any
received data on the endpoint.
On experiencing an internal error that requires a reset, a device must
either stall the endpoint being used in any data transfer in progress and
set bCSWStatus = 02h or stall the bulk IN and bulk OUT endpoints
until a reset recovery.
A mass-storage device may stall a bulk endpoints in these situations:
If a device expects to send more data than the host specified in the CBW,
Search WWH ::




Custom Search