embedded
config_error
ai_generated
partial
USB HID: Report descriptor too large, max allowed 64 bytes but descriptor size is 128 bytes
ID: embedded/usb-hid-report-descriptor-too-large
78%Fix Rate
83%Confidence
1Evidence
2024-06-19First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| STM32 USB Device Library 2.6.0 | active | — | — | — |
| TinyUSB 0.16.0 | active | — | — | — |
| ARM GCC 12.2.1 | active | — | — | — |
Root Cause
USB HID report descriptor exceeds the maximum size defined in device configuration descriptor (bMaxPacketSize0), typically 64 bytes for full-speed devices.
generic中文
USB HID 报告描述符超过设备配置描述符中定义的最大大小(bMaxPacketSize0),对于全速设备通常为 64 字节。
Official Documentation
https://www.usb.org/document-library/hid-usage-tables-112Workarounds
-
85% success Compress report descriptor by using short items (e.g., replace INPUT(Data,Var,Abs) with INPUT(Const) for unused fields) and remove redundant usage pages. Example: replace multiple 4-byte items with 2-byte short forms.
Compress report descriptor by using short items (e.g., replace INPUT(Data,Var,Abs) with INPUT(Const) for unused fields) and remove redundant usage pages. Example: replace multiple 4-byte items with 2-byte short forms.
-
75% success Switch to high-speed USB mode if hardware supports it (bMaxPacketSize0 = 512 bytes). Update device descriptor: bcdUSB = 0x0200 and configure PHY for HS. This allows larger report descriptors up to 512 bytes.
Switch to high-speed USB mode if hardware supports it (bMaxPacketSize0 = 512 bytes). Update device descriptor: bcdUSB = 0x0200 and configure PHY for HS. This allows larger report descriptors up to 512 bytes.
中文步骤
Compress report descriptor by using short items (e.g., replace INPUT(Data,Var,Abs) with INPUT(Const) for unused fields) and remove redundant usage pages. Example: replace multiple 4-byte items with 2-byte short forms.
Switch to high-speed USB mode if hardware supports it (bMaxPacketSize0 = 512 bytes). Update device descriptor: bcdUSB = 0x0200 and configure PHY for HS. This allows larger report descriptors up to 512 bytes.
Dead Ends
Common approaches that don't work:
-
Increase bMaxPacketSize0 in USB descriptor to 128 bytes
85% fail
bMaxPacketSize0 is limited by USB specification (64 bytes for full-speed, 512 for high-speed); increasing beyond spec causes host rejection.
-
Split report descriptor across multiple endpoints
90% fail
HID class does not support multi-packet report descriptors; descriptor must fit in one control transfer.