{
  "id": "embedded/usb-hid-descriptor-parsing-error",
  "signature": "USB HID: Report descriptor parsing failed at byte 12",
  "signature_zh": "USB HID：报告描述符在第12字节处解析失败",
  "regex": "USB HID: Report descriptor parsing failed at byte \\d+",
  "domain": "embedded",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "The HID report descriptor contains an unexpected or malformed tag, such as a short item with an invalid size field.",
  "root_cause_type": "generic",
  "root_cause_zh": "HID报告描述符包含意外或格式错误的标签，例如短项的大小字段无效。",
  "versions": [
    {
      "version": "USB HID class driver v2.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "TinyUSB v0.15.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Buffer size does not affect descriptor parsing; the error is due to invalid content, not insufficient memory.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Optimization levels do not change the binary content of the descriptor; parsing logic remains the same.",
      "fail_rate": 0.99,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Validate the HID report descriptor using a tool like HID Descriptor Tool, then correct the binary: ensure all items have proper lengths (e.g., `0x05 0x01` for Usage Page, not `0x05 0x01 0x00`)",
      "success_rate": 0.85,
      "how": "Validate the HID report descriptor using a tool like HID Descriptor Tool, then correct the binary: ensure all items have proper lengths (e.g., `0x05 0x01` for Usage Page, not `0x05 0x01 0x00`)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add a fallback descriptor in firmware that skips malformed items: `if (desc_byte == 0xFE) { skip_item(); } else { parse_item(); }`",
      "success_rate": 0.7,
      "how": "Add a fallback descriptor in firmware that skips malformed items: `if (desc_byte == 0xFE) { skip_item(); } else { parse_item(); }`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Validate the HID report descriptor using a tool like HID Descriptor Tool, then correct the binary: ensure all items have proper lengths (e.g., `0x05 0x01` for Usage Page, not `0x05 0x01 0x00`)",
    "Add a fallback descriptor in firmware that skips malformed items: `if (desc_byte == 0xFE) { skip_item(); } else { parse_item(); }`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.usb.org/document-library/hid-usage-tables-12",
  "official_doc_section": null,
  "error_code": "USB_HID_ERR_DESC_PARSE",
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}