Set USB Max Power for CDC Device Using STM32CubeMX?
I am using an STM32L4 device. I am making a USB device that uses CDC and have battery charge detection enabled. I need to request 500mA from the USB port if a standard downstream port is detected. It appears that the max power is hard-coded for 100mA in 'Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c' and that this will be overwritten by STM32CubeMX every time the project is regenerated if I modify this file.
Is there an expected way that this value should be changed for CubeMX projects? There does not appear to be any public interface into this device structure.
#stm32l4 #hal #usb #usb-power #cdc #stm32cubemx