Device stall an IN/OUT  endpoint

Question: In general, when should a Device stall an IN/OUT endpoint?

 

Answer:

As stated in Table 8-1 of the USB 2.0 spec (p. 196), STALL indicates that an endpoint is halted or a control pipe request (typically EP0) is not supported.  So for an IN/OUT endpoint, STALL indicates that the function corresponding to that endpoint has "locked up" and requires a command (clear endpoint feature HALT) to instruct the device to have internal software/firmware to "reset" the endpoint or clear/handle the cause for the "lock-up."  The EP should STALL when it no longer is able to operate as designed.