cancel
Showing results for 
Search instead for 
Did you mean: 

USB CDC Power request

PMath.4
Senior III

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

1 ACCEPTED SOLUTION

Accepted Solutions

USB devices request current through the bMaxPower field in the standard Configuration descriptor, so simply change it there.

0690X000009YuRCQA0.png

JW

View solution in original post

2 REPLIES 2

USB devices request current through the bMaxPower field in the standard Configuration descriptor, so simply change it there.

0690X000009YuRCQA0.png

JW

Peter Mather
Associate III

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 */