2012-03-09 3:29 AM
I have a hid report created using descriptor tool 2.4. The final descriptor size is 289. which appears to be to large (hid not detected). If I cut a few reports out so the size becomes less than 256 it works fine. Is it possible to increase the limit or do I need to do something else to get around this.
I'm using STM32_USB-FS-Device_Lib_V3.3.0 Thank you Michael2012-03-09 5:27 PM
Fix wItemLength field of HID descriptor (in the config descriptor set), as follows
usb_desc.c#define WBVAL(x) (x & 0xFF),((x >> 8) & 0xFF) // <--- add this definitionconst uint8_t CustomHID_ConfigDescriptor[CUSTOMHID_SIZ_CONFIG_DESC] = { ... ... /******************** Descriptor of Custom HID HID ********************/ /* 18 */ 0x09, /* bLength: HID Descriptor size */ HID_DESCRIPTOR_TYPE, /* bDescriptorType: HID */ 0x10, /* bcdHID: HID Class Spec release number */ 0x01, 0x00, /* bCountryCode: Hardware target country */ 0x01, /* bNumDescriptors: Number of HID class descriptors to follow */ 0x22, /* bDescriptorType */ // modify these two lines// CUSTOMHID_SIZ_REPORT_DESC,/* wItemLength: Total length of Report descriptor */// 0x00, WBVAL( CUSTOMHID_SIZ_REPORT_DESC ), /* wItemLength: Total length of Report descriptor */Tsuneo2012-03-10 9:19 AM
2012-03-10 9:58 AM
> your suggestion is pretty
Thanks, but such a macro is a standard way to fill two-bytes numbers into descriptors. You'll see this way in many USB examples from other resources. If ST team would learn the standard way, you shouldn't be trapped. TsuneoWe’re moving the ST Community to a new platform to give you a better and more reliable community experience.