# USB HID: Report descriptor parsing failed at byte 12

- **ID:** `embedded/usb-hid-descriptor-parsing-error`
- **Domain:** embedded
- **Category:** protocol_error
- **Error Code:** `USB_HID_ERR_DESC_PARSE`
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The HID report descriptor contains an unexpected or malformed tag, such as a short item with an invalid size field.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| USB HID class driver v2.5.0 | active | — | — |
| TinyUSB v0.15.0 | active | — | — |

## Workarounds

1. **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`)** (85% success)
   ```
   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`)
   ```
2. **Add a fallback descriptor in firmware that skips malformed items: `if (desc_byte == 0xFE) { skip_item(); } else { parse_item(); }`** (70% success)
   ```
   Add a fallback descriptor in firmware that skips malformed items: `if (desc_byte == 0xFE) { skip_item(); } else { parse_item(); }`
   ```

## Dead Ends

- **** — Buffer size does not affect descriptor parsing; the error is due to invalid content, not insufficient memory. (95% fail)
- **** — Optimization levels do not change the binary content of the descriptor; parsing logic remains the same. (99% fail)
