Issues in Firmware Package "STCubeFW_F4_V1.25.0" for USB HID Code Generation
Using Firmware Package "STCubeFW_F4_V1.25.0" in CubeMX appears to cause various issues with generating code for USB HID mode. I was originally able to get a USB HID project working by following the USB HID Custom Device Lab tutorial (found here https://www.youtube.com/watch?v=3JGRt3BFYrM&t=325s) using firmware package 1.24.1 with the STM32F405. USB functionality was broken after migrating my project to V1.25.0, which causes my USB PC Host to report "Transfer error on interrupt endpoint: Operation timed out". In order to verify the problem was in fact part of the V1.25.0 package, I repeated the ST tutorial linked above with both versions of the firmware package and verified that the project is able to communicate with the HID_Terminal .exe application in V1.24.1 but crashes the application with the V1.25.0 version.
Some other issues I noticed using CubeMX include the following:
- Setting the "CUSTOM_HID_FS_BINTERVAL" parameter in CubeMX does not have any effect on the code. The corresponding definition in "usbd_customhid.h" does not change regardless of what the value is set to.
- After following the tutorial to get my baseline project working, CubeMX will revert all the changes every time I regenerate my code to configure other peripherals. This is extremely frustrating and tedious to fix, and so far I haven't found a way to prevent this from happening. I would have expected the number of bytes transmitted to be configurable in CubeMX rather than fixed at 2 bytes. At the very least the default generated code should match the tutorial - as buffer pointer and 64 byte transfers are much more usable than the "state" and "event_idx" used in the "CUSTOM_HID_OutEvent_FS" routines.
