{
  "id": "embedded/usb-host-hcd-timeout",
  "signature": "USB: HCD timeout waiting for transfer completion on pipe 3",
  "signature_zh": "USB：HCD等待管道3传输完成超时",
  "regex": "USB:\\s*HCD\\s+timeout\\s+waiting\\s+for\\s+transfer\\s+completion\\s+on\\s+pipe\\s+\\d+",
  "domain": "embedded",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "USB host controller driver (HCD) timeout due to device not responding, incorrect endpoint configuration, or electrical noise on D+/D- lines.",
  "root_cause_type": "generic",
  "root_cause_zh": "USB主机控制器驱动超时，原因是设备无响应、端点配置错误或D+/D-线路上的电气噪声。",
  "versions": [
    {
      "version": "STM32Cube_FW_H7_V1.11.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "USB_Host_Lib 2.2.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "IAR EWARM 9.50.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "ARM GCC 12.2.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increasing USB host polling interval in HAL_HCD_IRQHandler()",
      "why_fails": "Longer polling intervals may cause missed transfers and do not solve underlying timeout.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "Re-enumerating the device by disconnecting and reconnecting in software",
      "why_fails": "Does not fix root cause; device may fail again due to same config error.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Adding a 100 ms delay before each USB transfer",
      "why_fails": "Degrades throughput and may violate USB timing specifications.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase USB host channel timeout value in HAL_HCD_Init(): hhcd.Init.TransferTimeout = 5000; (from default 1000 ms) and regenerate code.",
      "success_rate": 0.8,
      "how": "Increase USB host channel timeout value in HAL_HCD_Init(): hhcd.Init.TransferTimeout = 5000; (from default 1000 ms) and regenerate code.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add USB line debouncing in hardware: place 15 kΩ pull-down resistors on D+ and D- lines, and ensure VBUS is stable with a 10 µF capacitor.",
      "success_rate": 0.85,
      "how": "Add USB line debouncing in hardware: place 15 kΩ pull-down resistors on D+ and D- lines, and ensure VBUS is stable with a 10 µF capacitor.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reinitialize the USB host port after timeout: call HAL_HCD_Stop(&hhcd); HAL_HCD_Start(&hhcd); then retry the transfer up to 3 times.",
      "success_rate": 0.75,
      "how": "Reinitialize the USB host port after timeout: call HAL_HCD_Stop(&hhcd); HAL_HCD_Start(&hhcd); then retry the transfer up to 3 times.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase USB host channel timeout value in HAL_HCD_Init(): hhcd.Init.TransferTimeout = 5000; (from default 1000 ms) and regenerate code.",
    "Add USB line debouncing in hardware: place 15 kΩ pull-down resistors on D+ and D- lines, and ensure VBUS is stable with a 10 µF capacitor.",
    "Reinitialize the USB host port after timeout: call HAL_HCD_Stop(&hhcd); HAL_HCD_Start(&hhcd); then retry the transfer up to 3 times."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.st.com/resource/en/application_note/dm00250344-usb-host-and-device-library-on-stm32-mcus-stmicroelectronics.pdf",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.77,
  "resolvable": "true",
  "first_seen": "2024-04-22",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}