2019-07-19 01:01 AM
Does the STM USB CDC driver support power negotiation? If so please could someone point me to where I configure a request for more than the default 100mA.
I'm using STM32F407 and CDC is working nicely but the computer only shows that 100mA is requested. I need more than this to power peripherals which will be attached to the uP.
Any help appreciated
Solved! Go to Solution.
2019-07-19 01:22 AM
USB devices request current through the bMaxPower field in the standard Configuration descriptor, so simply change it there.
JW
2019-07-19 01:22 AM
USB devices request current through the bMaxPower field in the standard Configuration descriptor, so simply change it there.
JW
2019-07-19 03:48 AM
Thanks - took a bit of time to find as the field name misses the "b"
from usbd_cdc.c
__ALIGN_BEGIN uint8_t USBD_CDC_OtherSpeedCfgDesc[USB_CDC_CONFIG_DESC_SIZ] __ALIGN_END =
{
0x09, /* bLength: Configuation Descriptor size */
USB_DESC_TYPE_OTHER_SPEED_CONFIGURATION,
USB_CDC_CONFIG_DESC_SIZ,
0x00,
0x02, /* bNumInterfaces: 2 interfaces */
0x01, /* bConfigurationValue: */
0x04, /* iConfiguration: */
0xC0, /* bmAttributes: */
250, /* MaxPower 500 mA */