Author Topic: USB ennumeration when using a USB hub  (Read 4059 times)

ADB

  • Member
  • ***
  • Posts: 26
USB ennumeration when using a USB hub
« on: February 07, 2022, 02:06:36 am »
Hello,

I'm currently working on an embedded device that ennumerates as a high speed composite device (HID + VCOM) (USB 2). My device is configured to be bus powered with the max current set to 500 mA. When plugged directly into a laptop, the device ennumerates as expected and Vbus is 5.13V.

However if I connect my device through a powered USB2 hub, my device doesn't ennumerate and Vbus is 4.84V. According to my USB protocol analyzer, it doesn't go past the reset stage.

As another experiment, I cut up a USB cable, to expose VBus and GND and connected them directly to an external power supply and observed a current draw of 153 mA.

I suspect my device is drawing too much current, so Windows' doesn't allow it to ennumerate.

Should the 500mA be available from the outset or is only available after ennumeration? Does the USB standard specify a current value that my device shouldn't exceed during ennumeration?

Thanks in advance for your comments on this.

Regards,

Alan

Renate

  • Frequent Contributor
  • ****
  • Posts: 97
Re: USB ennumeration when using a USB hub
« Reply #1 on: February 07, 2022, 07:44:17 am »
Hmm... Is the hub correctly reporting itself as self-powered in bmAttributes (0x40) in the Configuration descriptor?
If not, then your device should only be allowed to draw 100 mA.
What is your device reporting in bMaxPower in its Configuration descriptor?
Is this in Windows, Linux, Mac? If Windows is it reporting over-current?

bpaddock

  • Frequent Contributor
  • ****
  • Posts: 66
Re: USB ennumeration when using a USB hub
« Reply #2 on: February 07, 2022, 08:14:03 am »
The USB 2.0 spec says 100 mA is the most, without negotiation for more.

As an experiment set your descriptor to 98 mA and see what happens.

Each PC/Device is different in how it reacts to what are perceived as high currents on USB ports.

I have a Dell with dead ports because of current, and Dell tells me I must take apart my machine to access the MB to fix it. :-(
Not a fall of Dells...



ADB

  • Member
  • ***
  • Posts: 26
Re: USB ennumeration when using a USB hub
« Reply #3 on: February 07, 2022, 02:30:17 pm »
Hi guys,

Thank you for getting back to me. On my Dell laptop running Windows 10, the bmAttributes for the USB hub is 0xe0, so the self powered flag is set and the max power is 0x32 (100mA).

I've set the max power of my device to 0xfa, which comes back as 500 mA in USB Device tree view. Windows isn't complaining about anything.

If I set my device max power value to 98 mA, windows doesn't display any error message.

It looks like I'm going to have to lower the current draw during ennumeration.

What's the point of having a mains powered hub? My device doesn't ennumerate in either the "standard USB ports" of the hub or the "powered ports".

Thanks again for your comments,

Alan

Renate

  • Frequent Contributor
  • ****
  • Posts: 97
Re: USB ennumeration when using a USB hub
« Reply #4 on: February 07, 2022, 05:12:18 pm »
We still haven't really narrowed it down.
It could be that the hub is flagging overcurrent (as sensed) but we're not seeing it at the OS.
It could be that the voltage drop is just too much.
You don't have any more hubs to try?
You don't have a Raspberry Pi to try?
Code: [Select]
$ sudo ~/hub 1-1
/dev/bus/usb/001/002
USB 2.0 hub 0424:9514 SMC SMC9514 (RPi), 5 port, per-port power
Port 1 status 0503 connect, enable, power, HS
Port 2 status 0100 power
Port 3 status 0103 connect, enable, power
Port 4 status 0503 connect, enable, power, HS
Port 5 status 0103 connect, enable, power
This would indicate overcurrent, but that's not the case.
You can also use the stock sudo lsusb -v but it's more verbose.

ADB

  • Member
  • ***
  • Posts: 26
Re: USB ennumeration when using a USB hub
« Reply #5 on: February 08, 2022, 09:02:33 am »
Hi Renate,

The only other hub that I have here at home is a USB 1.1 hub. Its hub descriptor comes up as follows:

bHubControlCurrent       : 0x64 (100 mA)
HubIsBusPowered          : 0x00 (Self Powered)

Oddly enough, my device ennumerates fine as a FS device.

I've started looking into detecting an overcurrent on my embedded device...

I don't have access to a Rasberry Pi.

Thanks again,

Alan