USE_USB_FS define in v1.25.0 not generated in Makefile
Firmware package v1.25.0 introduced new define for USB stack called USE_USB_FS. This isn't generated anywhere even when USB speed in CubeMX is set to "Device Full Speed 12MBit/s". Previously, the following defines have been used (and they still are!):
DEVICE_FS=0
DEVICE_HS=1
So you could pass to USBD_Init as last argument either DEVICE_FS (0) or DEVICE_HS (1) which worked fine. However, USBD_RegisterClass now has the following code block:
#ifdef USE_USB_FS
pdev->pConfDesc = (void *)pdev->pClass->GetFSConfigDescriptor(&len);
#else /* USE_USB_HS */
pdev->pConfDesc = (void *)pdev->pClass->GetHSConfigDescriptor(&len);
#endif /* USE_USB_FS */
Since I define my own ConfigDescriptors, I've set HS descriptor to NULL. Now, guess what happens since USE_USB_FS isn't defined anywhere? The program crashes - null pointer is accessed obviously.
Solution: If "Device Full Speed 12MBit/s" is checked in CubeMX, CubeMX should add USE_USB_FS to the list of defines.