2022-01-27 03:26 AM
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.
2022-10-09 06:45 PM
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?
2022-12-30 04:24 AM
I have seen various problems with custom HID with various versions, notified at many places :
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