2018-10-29 06:36 PM
STM32CubeMX and the L4 HAL 1.13.0 now sport an option to change the number of supported USB configurations.
I am trying to implement a USB interface that allows the host to choose between a CDC configuration that draws 500mA and one that draws 100mA. I have a battery powered device, and I want to present a CDC interface whether or not the battery can be charged.
It seemed like USBD_MAX_NUM_CONFIGURATION would help here. It seems to be a step in the right direction. I see two identical configurations enumerated. But I don't see any code in the USB layer that does anything with the configuration number when the host is enumerating or which would allow an application to alter or set a specific configuration.
Is there any documentation or example code illustrating how to make use of this new feature?