Skip to main content
Visitor II
January 27, 2022
Question

I have an issue with STM32L552 USB library. After sending an HID message once, the usb will send empty packets indefinitely (len=27, data len =0).

  • January 27, 2022
  • 2 replies
  • 1752 views

This is the data I recorded with WireShark. As shown in the picture, when I send HID packet once (len=91), the USB will send empty data packets indefinitely (len=27), then trying to send packets from host to device (out direction) will cause the transmission to fail. 

The USB middleWere was done by the CubeMX plus modifications that needed to support 64 bytes packets for custom HID.

I can’t find a way to stop or solve it.

Need to mention that this kind of problem has never appeared when doing the same on STM32F103.

    This topic has been closed for replies.

    2 replies

    Visitor II
    October 10, 2022

    I have a similar problem on STM32G491 custom HID. After sending the first packet I get continuous 0-byte IN transactions sent. Did you ever find a fix?

    Visitor II
    December 30, 2022

    I have seen various problems with custom HID with various versions, notified at many places :

    https://community.st.com/s/question/0D53W00000ttTa2SAE/what-is-the-issue-with-the-usb-custom-hid-low-level-driver?t=1672355984794

    https://community.st.com/s/question/0D53W00000vQ4iASAS/issue-with-stm32wb55-usb-custom-hid-using-v1111-firmware-pack

    https://community.st.com/s/article/how-to-implement-a-usb-device-custom-hid-class-on-stm32-part2

    etc. It seems Custom HID implementation is not really taken seriously at ST.

    What I find is that it depends a lot on the version of the Cube framework. People say that it works well with the 5.2 (but I was not able to install it on recent linux distribution), I found that it works on CubeMX 6.7 with Framework v. 1.11.0 but not with 1.11.3 for example. So you should not use "Use last version" but a given version. For me on a STM32F3-discovery it works well with 1.11.0 in custom HID.

    Hope this helps,

    Mike