stm32_mw_usb_device icon indicating copy to clipboard operation
stm32_mw_usb_device copied to clipboard

Bug Fix: Most 16-bit Descriptor lengths assumed 8-bit input.

Open berkakinci opened this issue 2 years ago • 3 comments

Most 16-bit Descriptor lengths assumed high bits were 0x00. This caused warnings and weird unexpected behavior when attempting to use descriptors longer than 255 bytes.

IMPORTANT INFORMATION

This was low-hanging fruit and an annoying oversight. HID report descriptors easily get larger than 255 bytes. This was the only fix necessary to make larger HID report descriptors work for me. I fixed all the 16-bit values while I was there.

A corresponding fix is necessary for STM32CubeMX. There is an artificial "255" limit on Class parameter: USBD_CUSTOM_HID_REPORT_DESC_SIZE. With this fix, it can be larger. I'm using 587 bytes currently. There may be more limits to relax, but this was the only one in my way.

Contributor License Agreement (CLA)

  • The Pull Request feature will be considered by STMicroelectronics after the signature of a Contributor License Agreement (CLA) by the submitter.
  • If you did not sign such agreement, please follow the steps mentioned in the CONTRIBUTING.md file.

berkakinci avatar Aug 26 '21 22:08 berkakinci

Hi @berkakinci,

Thank you for this proposal and the clarity of your report. It will be forwarded to our development teams for analysis. I will get back to you as soon as I get their feedback.

With regards,

ALABSTM avatar Sep 20 '21 09:09 ALABSTM

Hi @berkakinci,

Our development teams agree with your proposal. Actually such enhancement has already been decided and shall be integrated into a future release, not for the short term however.

We will keep you updated. Thank you for your comprehension and thank you again for this contribution.

With regards,

ALABSTM avatar Oct 04 '21 14:10 ALABSTM

ST Internal Reference: 119955

ALABSTM avatar Dec 22 '21 17:12 ALABSTM