# USB HID: endpoint 0x81 stalled, host reset required

- **ID:** `embedded/usb-hid-endpoint-stall`
- **Domain:** embedded
- **Category:** protocol_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

USB HID endpoint stalled due to protocol violation (e.g., report size mismatch, invalid report ID, or host sending unsupported request).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| USB HID v1.11 | active | — | — |
| STM32 USB Device Library v2.6.0 | active | — | — |
| TinyUSB v0.15.0 | active | — | — |

## Workarounds

1. **Verify HID report descriptor matches the actual report size sent. Use a USB analyzer (e.g., Wireshark with usbmon) to capture host requests and ensure firmware responds correctly.** (85% success)
   ```
   Verify HID report descriptor matches the actual report size sent. Use a USB analyzer (e.g., Wireshark with usbmon) to capture host requests and ensure firmware responds correctly.
   ```
2. **Implement a callback to clear endpoint stall on host request (e.g., ClearFeature(ENDPOINT_HALT)). In STM32 USB stack, override USBD_HID_SetupStage.** (80% success)
   ```
   Implement a callback to clear endpoint stall on host request (e.g., ClearFeature(ENDPOINT_HALT)). In STM32 USB stack, override USBD_HID_SetupStage.
   ```

## Dead Ends

- **Re-enumerate the device by power-cycling the USB cable** — The stall condition persists because the firmware does not clear the endpoint halt condition; enumeration alone does not fix the logic error. (70% fail)
- **Increase USB buffer size to accommodate larger reports** — Stall is caused by protocol mismatch, not buffer overflow; larger buffers do not resolve incorrect report descriptors. (85% fail)
- **Disable endpoint halt in firmware unconditionally** — Forces data transfer but may cause host-side timeout or data corruption if the report format is still invalid. (60% fail)
