# USB：主机控制器驱动队列在端点0x81上停滞，传输无法继续

- **ID:** `embedded/usb-hcd-queue-stall`
- **领域:** embedded
- **类别:** protocol_error
- **错误码:** `HCD_ERR_STALL`
- **验证级别:** ai_generated
- **修复率:** 78%

## 根因

USB主机控制器驱动在批量或控制端点上收到了设备的STALL握手信号，但驱动未清除该停滞状态，导致传输队列挂起。

## 解决方案

1. ```
   Send a CLEAR_FEATURE control request to the stalled endpoint. Example using STM32 HAL: HCD_EP_ClrStall(&hhcd, ep_addr); where ep_addr is the endpoint address (e.g., 0x81).
   ```
2. ```
   Implement a recovery state machine in the USB class driver that detects stall events and automatically re-enqueues the transfer after clearing the halt.
   ```

## 无效尝试

- **** — Resetting the entire USB bus without clearing the endpoint stall causes the device to re-enter the same stall state immediately. (70% 失败率)
- **** — Increasing the USB transfer timeout does not resolve the stall; the device will remain stalled indefinitely. (90% 失败率)
