USBX custom class
I'm developing firmware on a G0-family device. I've implemented a CDC-ACM device based on one of the USBX sample applications. Windows finds it, enumerates it and I can open it as a COM port. That's all working.
Now I want to add a second interface, using a custom class that I'll define myself. I'll start with the DPUMP sample application, as found on the USBX GitHub and whose .h file is found at MyProject/Middlewares/ST/usbx/common/core/inc/ux_device_class_dpump.h
In ux_device_descriptors.h, I need to extend USBD_CompositeClassTypeDef to define a new class type, like this:
/* Enum Class Type */
typedef enum
{
CLASS_TYPE_NONE = 0,
CLASS_TYPE_HID = 1,
CLASS_TYPE_CDC_ACM = 2,
CLASS_TYPE_MSC = 3,
CLASS_TYPE_CDC_ECM = 4,
CLASS_TYPE_DFU = 5,
CLASS_TYPE_DPUMP = 6,
} USBD_CompositeClassTypeDef;
But every time I generate code with CubeMX (I'm using STM32CubeIDE), this change gets overwritten because it's not in a USER CODE section. I've read all the docs I can find but I can't find a technique for doing this.
What's the recommended method for implementing a vendor-defined USB class? In all of ST's docs advocating the shift to ThreadX/USBX, there was a mention that USBX supported custom classes. I assume that means there's a clean way to get this happening in CubeMX.
