|
|
Log in / Subscribe / Register

USB charging, part 1: requirements

July 7, 2016

This article was contributed by Neil Brown

USB, the Universal Serial Bus, was primarily designed to transfer data to and from peripherals, with a secondary function of providing power to those peripherals so that they don't need to be independently powered. This secondary function has gained importance over the years, so that today it is sometimes the primary or only function. Many smartphone owners regularly use USB to charge their device but rarely, if ever, transfer data over USB. When Linux is running on that smartphone it needs to be able to optimize the use of whatever power is available over the bus — a task that is neither straightforward nor cleanly implemented in mainline Linux. We start this two-part series by looking at how USB communicates power availability information and will conclude in the second part by looking at how Linux does, or more often doesn't, make use of this information.

To begin, it will be helpful to be clear about some terminology. USB is an asymmetric bus — the two connected peers each play different roles. One peer is the master, or initiator, and controls all the data flow; it is known as the "host" and has an A-series connector (or receptacle) or, possibly, a B-series plug. The other peer is the slave, or responder, that can only send or receive data when the host tells it to. This is known as a USB "device" though, since "device" is an overly generic term, it is sometimes referred to as a "gadget". A USB gadget has a B-series connector, of which there are a range of sizes, or an A-series plug.

A USB cable connecting a host to a gadget typically has 4 wires. Two carry power, VBUS and GND, and two carry data, DP and DM, also known as D+ and D-. Power normally flows from the host to the gadget, but this is not universal as we shall see later. USB 3.0 adds extra wires and pins to the A-series and B-series connectors to carry "SuperSpeed" data, but only changes power delivery in that power flowing in different directions can flow over different wires. The USB 3.0 C-series cable is bidirectional and does add extra power signaling options, but the details of that would not particularly help the present discussion.

Some USB peers can serve as either a host or a gadget using a specification known as USB On-The-Go — USB-OTG. These devices have a B-series connector with a fifth pin called ID. The port will act as a gadget port unless a cable is plugged that connects the ID pin to GND, possibly through a resistor. When that happens, the device will switch the port to host mode so it can control an attached gadget.

From the perspective of a mobile battery-powered Linux device with a B-series port, the important question is: how much power can be drained from the bus and used in the device? As the voltage is fixed at 5V ±5% this is equivalent to a question of how much current can be drained, and the answer is usually given in milliamps (mA). The device will typically have power-management circuitry that can limit the current used, and other circuitry that will divert some to charging the battery when that is appropriate, but those details are not really important at this stage. For now, we only care about a number.

The USB Implementers Forum provides several multi-page specifications describing how to get that number, in particular the Battery Charging v1.2 document ("BC-1.2", which is my primary source and comes from the Class Specification page) and the newer USB Power Delivery spec. In practice, there are two classes of answers.

Current from a Standard Downstream Port

The first class of answers applies when the device is connected by a standard cable to a standard A-series host port such as on a notebook or desktop computer. A USB host provides a "Standard Downstream Port" (SDP). These ports must provide 100mA for at least the first second after attachment and can be configured to deliver more — up to 500mA in USB-2 — after enumeration has completed. If no enumeration happens, the port is expected to become suspended after 1 second at which point only 2.5mA is available.

Enumeration involves the host asking the gadget (in this case, our mobile Linux device) about its configuration options, and then requesting that some specific configuration be activated. More details on enumeration can be found in an earlier article on the USB composite framework. A configuration includes the amount of current that will be required, which may be close to zero for a separately powered device, or may be the maximum supported for something that is power hungry and fully bus-powered. The host knows what it can provide and will ignore any configuration that requires too much power.

This protocol is quite suitable for a gadget that is dependent on bus power and needs a certain amount of current or else it cannot reliably function. It is less suitable for a battery-powered gadget like a smartphone that can function with no bus-power at all, but would be happy to receive as much as is available. Such a device can present two (or more) distinct configurations to the host: one that claims to require 500mA and a second one that requires zero. A host with power to spare should activate the first one. A host that cannot provide this power should reject the first and accept the second.

Current from other port types

There are a variety of other port types that a USB gadget can find itself connected to. A Dedicated Charging Port (DCP) provides power, at least 500mA, but no data. A Charging Downstream Port (CDP) provides data access much like an SDP, but also provides at least 1.5A, and as much as 5A, that is available even before bus enumeration. USB C-series connectors introduce more options with the same maximum current of 5A, though there is the possibility of increasing the voltage up to 20V, which would yield 100W of power.

For USB-OTG there is an extra port type, the Accessory Charger Adapter (ACA) as well as an extended form: the ACA-Dock. The ACA switches the OTG port into host mode, but also provides power to it, rather than requiring power from it. The ACA-Dock provides power and can switch the OTG port between host and gadget mode, presumably based on what else is plugged into the dock. An ACA-Dock will provide at least 1.5A, while a simple ACA can provide as little as 500mA.

Each of these peers can be detected directly by the USB PHY — the circuitry responsible for the physical interface with the bus. This detection happens without needing to enter enumeration negotiations, so if power is available it can be accessed quickly.

USB connection negotiations between a host and a gadget start with the host providing a 5V level on VBUS and the gadget PHY detecting this voltage. The PHY then advertises its existence to the host by pulling one of DP or DM up to the same level as VBUS, the choice of pin giving some indication of supported bus speed. At this point the host starts enumeration. Before it applies the full VBUS voltage, the PHY can send other signals at a lower voltage and check the response. The simplest case involves setting a low voltage (e.g. 2V) on DP and checking if it is echoed back on DM. Seeing the same 2V on DM strongly implies that the DP and DM lines are shorted together, which is how a dedicated charger (DCP) can be detected. A similar but more complex signalling will detect a CDP.

For a USB-OTG port, the ID pin is supplied with 5V and, when there is no cable plugged in or when a normal 4-pin B-series plug is in place, it will stay at 5V drawing no current. As mentioned, an OTG cable will pull this pin down to GND and if a resistor is used to pull it down the resistance indicates the type of device. If ID is a short-circuit to GND, or shows a resistance of at most 1kOhm, then a simple gadget that doesn't provide any power is being attached. The OTG must provide 5V to VBUS and cannot expect anything back. If a resistance is measured between 1kOhm and 200kOhm (the minimum to be considered open-circuit), then some sort of ACA is implied and the specific resistance indicates the type of ACA.

The USB PHY controller in the mobile device can usually perform these various tests in hardware, possibly with some software support, the moment that a voltage change is detected, and can make the results available to the Linux driver. The Linux driver then just needs to tell the power-management driver how much current to draw.

A range of options

When connected to an SDP, and after a configuration has been negotiated, a simple number is available to the Linux device so it knows how much current it can draw — the number that was requested in the configuration that was activated. In theory, it should be safe to draw that much current at 5V. When attached to other port types, it isn't quite so simple.

According to BC-1.2, the current provided by a dedicated charger, DCP, is IDCP, which has a minimum of 500mA and a maximum of 5A. Similarly, a CDP provides ICDP, which ranges from 1.5A to 5A. ACA configurations have ranges too, the lower ends of which were mentioned earlier. Setting a current limiter in the portable device to a single number is normally quite simple. If we only have a range of allowable values, it isn't immediately clear what number we should use.

The intended meaning of these ranges is that the power source must provide at least the minimum listed current at a voltage within 5% of the 5V target, so at least 4.75V. Demands for higher current may cause the voltage to drop and, at some point, the supply may cut out completely. The supply should not cut out while the current is below the maximum, unless the voltage has first dropped below 2V.

[Power response curves]

The graph at right (click for larger, animated version) shows hypothetical power curves that could be presented by chargers, which would be within specifications. As the load increases, the current provided increases, and then eventually the voltage starts to drop. The key requirements of the specification are that the trace must never enter the grey areas and that the charger must not shut down (depicted by a black disk) before the trace enters a pink area. This blog post shows some power curves presented by real devices.

Pulling all of this together, the negotiations on the bus will provide an upper and lower bound for the amount of current that can be drawn. The device can safely request the minimum and if that is less than the maximum it can then slowly increase the requested current until the maximum is reached, or until the supplied voltage drops below some device-specific threshold that must be greater than 2V and at most 4.75V. Each voltage level should be averaged over 250ms to avoid being confused by transients.

While this procedure should be safe, it is not unheard of for charging hardware to be less than perfect, and some cables can introduce more resistance than one would like. So a truly cautious driver would start requesting current well below the negotiated minimum and advance slowly with large margins for error.

Dead batteries — when we don't have the luxury of time

One situation that is particularly difficult to handle with USB charging is that of a dead battery. If a device had a dedicated power supply, with known characteristics, and, in particular, if it was certain of a supply of a few hundred mA, then the hardware could be designed to boot with only external power — even if there is no battery. With USB there is no such guarantee. The only guarantee that USB provides without any negotiation is that 100mA can be used for up to 1 second, but longer term only 2.5mA is certain to be available. 100mA is barely enough power to boot Linux on current hardware, 2.5mA is certainly insufficient.

One option is to simply ignore the specification and pull 100mA anyway. Many chargers will support this and those that don't should just shut down, which is no worse than trying to survive with 2.5mA. There is, however, a better option.

BC-1.2 defines a Dead Battery Provision (DBP) which allows for an extremely simple handshake to request that 100mA be available for a longer term — up to 45 minutes. If the gadget device places a voltage of 0.5V on the DP pin, this will keep the bus from entering the suspended mode, so the drop to 2.5mA never happens. When making use of the DBP, the device is strongly encouraged to limit its activities to only those which are required to charge the battery to the "Weak Battery Threshold", and then activate just enough hardware to properly respond to USB enumeration and negotiate available power correctly.

To proceed correctly requires hardware that knows to set DP appropriately when the battery is flat, and software to avoid turning on any unnecessary components until the power state has been properly established.

The task at hand

To summarize, the tasks that Linux must support for full compliance are:

  • find out from the USB PHY what type of cable is attached and report this to the battery charger
  • advertise USB gadget configurations with appropriate power demands
  • determine which gadget configuration was chosen and report the available power to the battery charger
  • adjust current within the given range to maintain suitable voltage
  • detect when the power supply is questionable during boot and limit activation of components until that is resolved

In the concluding article, we will have a look at the various device types within Linux that are responsible for these different tasks and at how they work together to produce a charging solution.

Index entries for this article
KernelUSB
GuestArticlesBrown, Neil


to post comments

USB charging, part 1: requirements

Posted Jul 8, 2016 19:34 UTC (Fri) by corsac (subscriber, #49696) [Link] (3 responses)

When the battery is dead, can't the bootloader (usually uboot) boot with 2.5mA and actually enumerate USB to get more power?

USB charging, part 1: requirements

Posted Jul 9, 2016 23:37 UTC (Sat) by neilbrown (subscriber, #359) [Link] (2 responses)

> When the battery is dead, can't the bootloader (usually uboot) boot with 2.5mA and actually enumerate USB to get more power?

2.5mA isn't very much. It should be enough to keep memory refreshed while the CPU is suspended, but not much more. It is the sort of current that would allow a keyboard to detect a keypress and send a wake-up to the host to say "please ask me what key is pressed", and maybe to keep a couple of LEDs on. It should let an optical mouse keep the light on just enough to detect some movement so again it can trigger a wake-up

An Arduino microcontroller which is a slow, low-power CPU that cannot run Linux (unless maybe if you trimmed it down a lot) uses around 20-30 mA. An OMAP3 which is a TI processor from a few years ago needs a couple of hundred mA to do anything useful.
There may be more modern processors which get away with less power, the "LITTLE" part of big.LITTLE designs do aim for very low power. They might be able to respond to bus enumeration with under 100mA, but I know no specifics.

If you need a CPU to be involved in negotiating the current (rather than using purpose-built hardware), then you need to be sure of at least a few seconds of a few hundred mA from the battery. If the CPU manages to negotiate 500mA or more in those few seconds it should be fine to boot. If not, it is back to sleep until the battery builds up a more substantial charge.

USB charging, part 1: requirements

Posted Jul 11, 2016 0:35 UTC (Mon) by giraffedata (guest, #1954) [Link] (1 responses)

OK, 2.5mA is really niggardly, but what about 100 mA for a second? Isn't that enough time for a boot loader to come up and enough to negotiate more?

USB charging, part 1: requirements

Posted Jul 11, 2016 10:13 UTC (Mon) by neilbrown (subscriber, #359) [Link]

1 second is certainly enough for a u-boot to be loaded and do something useful. I don't know if it is long enough to complete usb negotiation, but I suspect it is.
But for many processors, 100mA isn't enough to execute any instructions, let alone load the boot-loader from nand-flash which is most likely where it is. There maybe be some Linux-capable platforms which can run the boot-loader with only 100mA, but I doubt they are common.

USB charging, part 1: requirements

Posted Jul 9, 2016 18:55 UTC (Sat) by marcH (subscriber, #57642) [Link] (11 responses)

> The other peer is the slave, or responder, that can only send or receive data when the host tells it to. This is known as a USB "device" though, since "device" is an overly generic term, it is sometimes referred to as a "gadget".

What was perceived wrong with USB "slave" that motivated the invention of "gadget"?

USB charging, part 1: requirements

Posted Jul 10, 2016 20:00 UTC (Sun) by flussence (guest, #85566) [Link]

I guess it makes sense to call it differently, since USB is wedged somewhere between ATA's master/slave model and FireWire's peer-to-peer model. One side *is* the bus owner, but when it's normal to plug a pocket supercomputer into a brainless charging adaptor where both sides are USB-spec-compliant (hopefully), the existing terminology becomes kind of meaningless.

USB charging, part 1: requirements

Posted Jul 10, 2016 22:56 UTC (Sun) by anselm (subscriber, #2796) [Link] (9 responses)

There seems to be a general trend away from loaded terms like “master” and “slave” and towards more neutral terms. For example, what used to be called a “slave DNS server” is now often referred to as a “secondary DNS server”.

USB gadget vs slave

Posted Jul 11, 2016 0:10 UTC (Mon) by marcH (subscriber, #57642) [Link] (7 responses)

This "trend" crossed my mind only after I posted the question...

While the terms master and slave don't bring any good memories, they happen to have perfect technical accuracy. I wouldn't mind trading them against other terms, however it's going to be difficult to find alternatives which are both accurate and PC at the same time since the relationship between two pieces of hardware tends to be more brutal than touchy-feely. "Gadget" falls quite far off the mark.

From: flussence
> ... a pocket supercomputer into a brainless charging adaptor ...

Brainless power: see how the master/slave terminology is even more accurate in this particular case?

Anyway: while charging is an important and growing topic (thanks for the article), it's still not the bulk of the USB spec/complexity/implementation/etc.

USB gadget vs slave

Posted Jul 11, 2016 8:16 UTC (Mon) by farnz (subscriber, #17727) [Link] (2 responses)

Except that, in a deep and technical sense, the brainless power adapter is the USB "master" or "host", while the supercomputer attached to it is the "slave", "device", or "gadget".

And OTG makes it even more complex, as the "host" role can swap between devices.

USB gadget vs slave

Posted Jul 11, 2016 11:05 UTC (Mon) by tao (subscriber, #17563) [Link] (1 responses)

I think that was the whole point? That the slave owners are the brainless ones...

USB gadget vs slave

Posted Jul 11, 2016 13:13 UTC (Mon) by farnz (subscriber, #17727) [Link]

Trouble with that is that the terminology swaps around - the pocket computer is the device, whether it's attached to a desktop supercomputer host that outpaces it, or to a dumb charger host that couldn't outpace a 1970s home computer :)

USB gadget vs slave

Posted Jul 11, 2016 17:00 UTC (Mon) by mbunkus (subscriber, #87248) [Link] (3 responses)

> While the terms master and slave don't bring any good memories, they happen to have perfect technical accuracy.

I respectfully disagree with the term being technically accurate. For me the relationship between master & slave has two connotations: one is a question of rights (as in the slave doesn't have any and the master can order it/him/her around to do whatever) and one is who's doing the work (as in the slave does all the work and the master only assigns, supervises, punishes).

However, there are many situations where us admins speak about master/slave in technical environments and where those connotations don't really fit:

1. Databases. Here the master is often simply the single point where data can be changed. However, it's not like the master is not doing any work — often enough the work is divided somewhat equally between all nodes in the cluster.

2. High-availability clusters. Here the master is the one actually doing all the work, and it isn't even telling the slave what to do all the time. Usually the slave machine verifies that the master is still alive and takes over if that check fails — but that's usually not initiated by the master but by the slave's own will — and the nodes suddenly switch their roles, too. They're more often called active/passive clusters, and that's a much more fitting term to me; it's much more of a relationship between equal partners than any kind of hierarchy.

3. DNS servers. Again the masters may or may not do a significant amount of work depending on whether or not it's listed as a NS for the domain in question. Additionally it doesn't instruct the slave to update its files, it only notifies the slave. The slave decides based on its configuration if and when to update its zones. On top of that master and slave servers are often run by different entities (companies).

We use master/slave for so many different cases in tech that I'd prefer not to use them even without considering the historical context of those terms.

USB gadget vs slave

Posted Jul 11, 2016 17:13 UTC (Mon) by pizza (subscriber, #46) [Link] (1 responses)

> I respectfully disagree with the term being technically accurate. For me the relationship between master & slave has two connotations: one is a question of rights (as in the slave doesn't have any and the master can order it/him/her around to do whatever) and one is who's doing the work (as in the slave does all the work and the master only assigns, supervises, punishes).

There's a third connotation -- the question of authority. Ie the master is authoritative, the slave is not.

USB gadget vs slave

Posted Jul 11, 2016 21:37 UTC (Mon) by marcH (subscriber, #57642) [Link]

> There's a third connotation -- the question of authority. Ie the master is authoritative, the slave is not.

Yes - this is how this terminology has been successfully been used for decades.

Which side has authority and decides matters to correctness as in "Does it work?". Black/white questions[*]. Who does the work is optimization territory = quantitative stuff. Glad the terminology relates to the former.

[*] Sorry; really couldn't resist this one :-)

> > I respectfully disagree with the term being technically accurate.

"Send patches"

USB gadget vs slave

Posted Jul 14, 2016 1:24 UTC (Thu) by kevinm (guest, #69913) [Link]

These are some great points, and I would suggest that for all of these examples a pair of terms borrowed from partner dance would be appropriate: Leader / Follower. There's no connotation there of one doing more work than the other; there's the implication of "call and response" (another term from partner dance); and the possibility of switching roles as in the HA cluster case is apropos.

USB charging, part 1: requirements

Posted Jul 14, 2016 2:15 UTC (Thu) by gdt (subscriber, #6284) [Link]

The sentiment is correct but the DNS example is incorrect.

Mockapetris in RFC882 used "primary/secondary" to refer to the role of servers and "master/slave" to refer to the origin of DNS records. Terminology to distinguish the servers and the records they serve is perhaps too fine to be useful once the DNS system existed, whatever clarity the differing terminology bought during the design of the DNS system.

The use of primary/secondary in BIND4 configurations confused many. Master/slave was felt to be clearer and appeared in BIND8 configuration.

"Original" and "copy" — or many other suggestions — may have been better and perhaps clearer terms, but that would have required BIND to break away entirely from the terminology in the DNS RFCs.

Then there's the question of if inanimate objects such as servers should be anthropomorphised to the extent that a "slave server" is not a "neutral term"; a topic I am unqualified to determine.

USB charging, part 1: requirements

Posted Jul 11, 2016 9:09 UTC (Mon) by roblucid (guest, #48964) [Link] (1 responses)

Thanks Neil, your articles are always a very interesting read!

As for this, not having any hardware background the intricacies of something "you just plug in" has been eye opening.

USB charging, part 1: requirements

Posted Jul 25, 2016 16:48 UTC (Mon) by koala_man (guest, #109913) [Link]

Totally agree. I've noticed that certain combinations from my ever-growing pile of chargers and adapters make gadgets behave in vaguely different ways. This article finally put it into context!

Much appreciated, Neil!

USB charging, part 1: requirements

Posted Jul 14, 2016 14:48 UTC (Thu) by bleung (guest, #96239) [Link] (1 responses)

Hi Neil,

Thanks for posting this informative article.

Several minor corrections.
#1 : The two data carrying wires are Dp and Dn or D+ and D-, not DP and DM.

#2: There is no such thing as "USB 3.0 C-series"

There is USB Type-C, which is a third type of connector introduced in 2014. USB Type-C is intended to replace both Type-A and Type-B connectors and plugs. It is not required that USB Type-C ports support USB 3.0 or USB 3.1 data rates. In fact, many of the implementations on phones today use Type-C but only connect the receptacle to USB 2.0 Host and Device controllers, and most of the Type-C cables on the market today are USB 2.0 only, meaning they have only the base 4 wires, and none of the SuperSpeed wires.

USB Type-C and the related specification USB Power Delivery introduce much more complex and more rigidly defined power capabilities than the USB BC 1.2 you write about. It may be worthwhile for you and I to at some point to collaborate and do a more detailed explainer about USB-C and PD charging in the future!

See my explanation of USB Type-C Configuration Channel, for example : https://plus.google.com/+BensonLeung/posts/4xq4EDjXMw8

Also, my G+ collection for USB Type-C Explained :
https://plus.google.com/collection/0Vdov

Thanks!
Benson

USB charging, part 1: requirements

Posted Jul 14, 2016 14:53 UTC (Thu) by bleung (guest, #96239) [Link]

Nix my first minor correction. It looks like "DM" for "Dee-Minus" is also acceptable and widely used as much as "Dn" for "Dee-negative"

USB charging, part 1: requirements

Posted Jul 17, 2016 3:22 UTC (Sun) by WolfWings (subscriber, #56790) [Link] (1 responses)

And despite all this well-written documentation, most devices out in the wild (and thus most chargers and so-forth) that aren't using USB-C ports simply wire up the data pins to specific voltages to advertise what amperage they support and the devices suck down power if that's high enough.

Thank Apple for simply implementing something years (a decade really) before any real (and quite complicated) standard came out, so that's become the de-jure standard even if it's not officially any kind of standard. And that de-jure standard is what those $8 wall-plug adapters your local membership-store has on the shelf, not ones that follow the full USB charger spec.

USB charging, part 1: requirements

Posted Jul 18, 2016 21:26 UTC (Mon) by chfisher (subscriber, #106449) [Link]

I think you meant de facto, not de jure.

de facto - adverb "in fact, or in effect, whether by right or not."

de jure - adverb "according to rightful entitlement or claim; by right." - implying it is the legal standard/

USB charging, part 1: requirements

Posted Jul 25, 2016 20:23 UTC (Mon) by eds (guest, #69511) [Link] (11 responses)

So If I connect a battery-powered device to a host computer, USB data communication is required before charging can begin.

But what if I don't trust the host computer? And use a cable or adapter that connects the power pins but not the data pins. Does that mean the host will (and should) refuse to supply sufficient charging current, because no device enumeration occurred?

USB charging, part 1: requirements

Posted Jul 25, 2016 21:04 UTC (Mon) by mohaine (guest, #6101) [Link]

Yes. You should get 100 ma that will quickly degrade to 2.5 ma.

USB charging, part 1: requirements

Posted Jul 25, 2016 22:43 UTC (Mon) by mathstuf (subscriber, #69389) [Link] (7 responses)

If you don't trust the host computer…don't plug a cable into it? If you want just power, look to the SyncStop[1] (formerly the "USB Condom").

[1]http://syncstop.com/

USB charging, part 1: requirements

Posted Jul 26, 2016 6:15 UTC (Tue) by eds (guest, #69511) [Link] (6 responses)

Yes, I'm specifically asking what happens when such a device is in use. SyncStop blocks the data pins, which is exactly what I described.

If no data pins means no enumeration, and no enumeration means the host will cut the current back, then it's not a very useful way to recharge.

USB charging, part 1: requirements

Posted Jul 26, 2016 10:48 UTC (Tue) by gioele (subscriber, #61675) [Link] (2 responses)

> Yes, I'm specifically asking what happens when such a device is in use. SyncStop blocks the data pins, which is exactly what I described.
>
> If no data pins means no enumeration, and no enumeration means the host will cut the current back, then it's not a very useful way to recharge.

What SyncStop/USB condom should do is to have a chip connected to the data pins that does the enumeration-dance with the host and, once it is done, it should forward the current to the gadget/phone/camera attached to it. In this way the enumeration is done, but not by the phone/camera itself.

USB charging, part 1: requirements

Posted Jul 26, 2016 14:12 UTC (Tue) by jezuch (subscriber, #52988) [Link] (1 responses)

> What SyncStop/USB condom should do is to have a chip connected to the data pins that does the enumeration-dance with the host and, once it is done, it should forward the current to the gadget/phone/camera attached to it.

How does it know that it doesn't send too much power for the device not to fry?

USB charging, part 1: requirements

Posted Jul 26, 2016 15:40 UTC (Tue) by jem (subscriber, #24231) [Link]

A power supply does not send power to a device, the device draws power from the supply. The voltage is fixed at 5 volts (newer versions can supply 20 volts, when negotiated), the current drawn is up to the device.

USB charging, part 1: requirements

Posted Jul 26, 2016 11:26 UTC (Tue) by mathstuf (subscriber, #69389) [Link] (2 responses)

Yes, it blocks the data pins to your device, but will negotiate on its behalf (and as a "proof" it doesn't put data through to your device, it doesn't hook the data lines up in that side).

USB charging, part 1: requirements

Posted Jul 29, 2016 5:38 UTC (Fri) by eds (guest, #69511) [Link] (1 responses)

I can find no evidence that SyncStop / USB condom has anything at all connected to the data lines. Everything I've seen describes it as a passthrough with data lines cut.

But perhaps I just haven't searched hard enough. Do you have a link? Or know of a competing product that does this?

USB charging, part 1: requirements

Posted Jul 29, 2016 5:41 UTC (Fri) by mathstuf (subscriber, #69389) [Link]

It has to communicate with the host for power. Otherwise it's just be a simple cable which doesn't route any of the data lines at all. It doesn't have data lines to the device side though.

USB charging, part 1: requirements

Posted Jul 26, 2016 0:56 UTC (Tue) by neilbrown (subscriber, #359) [Link] (1 responses)

> Does that mean the host will (and should) refuse to supply sufficient charging current

No, it means that the host *may* refuse to supply sufficient charging current.

There are lots of USB-powered thingies around, like fans for summer, hand-warming mittens for winter, and pretty blinking lights for the festive season. They don't enumerate the bus, but they work fine when plugged into most USB sockets. If you tried to plug 4 of them into an unpowered USB hub, I suspect they wouldn't work. Hopefully the hub would detect the excess current draw and turn off.

The key point about battery powered mobile devices is that sometimes you plug in a USB cable to charge, sometimes to transfer data, sometimes for both. The device needs to know what to do. If it just pulled all the current it could, like the warming mittens, it might cause the port to shut down and then you would never get your cat photos. The mittens have no cat photos, so causing a port shutdown isn't a concern.

USB charging, part 1: requirements

Posted Jul 26, 2016 6:19 UTC (Tue) by eds (guest, #69511) [Link]

Thanks for the clarification.

I realize I have anecdotal evidence this is true, having charged my bicycle headlight off a laptop USB port many times.


Copyright © 2016, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds