Page 1 of 1

Determine USB Host

Posted: Wed Apr 02, 2025 7:32 pm
by sshwarts
In the device we're developing, we have two basic operational modes. One being a USB HID Host and the other being as a MSC Device. I have hardware that tells me if the source of power (am I receiving power as a UFP or am I providing power as a DFP.

What I can't tell in the UFP case is if I'm connected to a host computer or a charger. I've tried looking at the D+D- lines to see if I can detect the host pulling them high, but it doesn't work, I suspect, at boot, someone already has control of those IO lines.

Does anyone know a reliable way to tell?

Since it's two different stacks (MSC is tiny USB), there's probably no way to switch on the fly, and a reboot is required (that's ok if detection works).

Thanks

Re: Determine USB Host

Posted: Thu Apr 03, 2025 7:18 am
by ahsrabrifat
A USB host typically provides 5V on VBUS, but so does a charger. However, a USB host usually limits current to 500mA (USB 2.0) or 900mA (USB 3.0) unless proper enumeration occurs.