Author Topic: Configuration Descriptor  (Read 6770 times)

lcpoon

  • Frequent Contributor
  • ****
  • Posts: 58
Configuration Descriptor
« on: April 29, 2014, 05:05:45 am »
I would like to know why bmAttributes of 0XC0 is not "Self Powered" only?

I got this information "bmAttributes sets bit 6 = 1 if the device is self-powered and zero if bus powered.
Bit 5 = 1 if the device supports the remote wakeup feature, which enables
a suspended USB device to tell the host that the device wants to communicate.
The other bits in the field are unused. Bits 4..0 must be zero. Bit 7 must equal 1
for compatibility with USB 1.0" from USB Complete The Developer's Guide (4th Edition)0

From USB Device Viewer:

          ===>Configuration Descriptor<===
bLength:                           0x09
bDescriptorType:                   0x02
wTotalLength:                    0x0029  -> Validated
bNumInterfaces:                    0x01
bConfigurationValue:               0x01
iConfiguration:                    0x00
bmAttributes:                      0xC0  -> Bus Powered
MaxPower:                          0xFA = 500 mA

From USB Device Tree Viewer:

        -------------- Configuration Descriptor ---------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x02 (Configuration Descriptor)
wTotalLength             : 0x0029 (41 bytes)
bNumInterfaces           : 0x01
bConfigurationValue      : 0x01
iConfiguration           : 0x00
bmAttributes             : 0xC0 (Bus Powered, Self Powered)
MaxPower                 : 0xFA (500 mA)

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Configuration Descriptor
« Reply #1 on: April 29, 2014, 09:45:25 am »
Table 9-10 in the USB 2.0 spec says:

A device configuration that uses power from
the bus and a local source reports a non-zero
value in bMaxPower to indicate the amount of
bus power required and sets D6. The actual
power source at runtime may be determined
using the GetStatus(DEVICE) request (see
Section 9.4.5).

lcpoon

  • Frequent Contributor
  • ****
  • Posts: 58
Re: Configuration Descriptor
« Reply #2 on: April 29, 2014, 10:11:15 am »
It appears to me that non-zero bMaxPower value will overwrite bmAttributes settings --> configured as "Bus Powered".

So, if I would like to enumerate the device as "Self Powered",  I have to make sure that bMaxPower value = 0?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Configuration Descriptor
« Reply #3 on: April 29, 2014, 10:30:26 am »
From Table 9-10 again:

bMaxPower

Maximum power consumption of the USB
device from the bus in this specific
configuration when the device is fully
operational.

I'm not sure what you mean by "I would like to enumerate the device as "Self Powered"" - what matters is the value in bmAttributes, not how any particular tool interprets the value.