Hacker News new | ask | show | jobs
by kbos87 329 days ago
Can anyone tell me why I have several devices in my home that demand a certain USB-C cord in order to charge? They are mostly cheap Chinese devices that won’t acknowledge a more expensive (e.g., Apple) uSB-C cord plugged into them. Even when plugged into the same transformer. They only charge with the cheap USB-C cord they came with. What gives?
10 comments

Because the USB Consortium made a terrible mistake. Instead of speccing USB-PD power supplies to default to 5V <3A when there are no resistors in the port of the other device, the default is do nothing. So in order to be in spec, you have to refuse to charge non-compliant ports. This means the compliant power supplies are worse, in a way. So you need to use a "dumb" USB-A power supply and USB-A to C cable, which does default to 5V <3A to matter what. As for why some devices choose to use non-compliant ports - I assume it's extreme cheapness. They save a penny on a resistor.
At this point I'm even surprised that compliant cables and chargers exist so the GP can have that problem.

But I believe the specs are that way to avoid problems with OTG devices. If both devices decide to just push a voltage into the cable at the same time, you risk spending a great deal of energy or even start a fire. That said, there are better ways to deal with this issue; those are just slightly more expensive.

I think the Apple USB-C charger I have is compliant and so is the cable. I actually use it to charge my Samsung phone primarily, but inadvertently discovered that it won't run a Raspberry Pi 4 at all. The $12 adapter that is sold for that purpose runs the Raspberry Pi 4 just fine. Apparently because it just supplies 5 volts all the time, no matter what the device says.
The Raspberry Pi 4 has a design error in its USB-C circuitry.

It does include a pull-down resistor, but wired incorrectly (compliant devices need two), which results in compliant chargers only correctly detecting it when using a “dumb” (i.e. containing no e-marker chip) USB-C-to-C cable. Your Apple cable probably has a marker (all their Macbook charging cables have one, for example).

Thanks for the explanation. I actually found out the USB-C plug can act as a USB device. At USB 2.0 speeds oddly enough. So I have all my Pi 4s configured now in that mode and I just power them through the 5 volt header, which seems simpler. Albeit less convenient.

I had to get this USB "power blocker" that only passes the data pins through, otherwise the Pi runs off the computer it is plugged into all the time

> At USB 2.0 speeds oddly enough.

That's because USB 3 is not natively provided by the SoC on the RPi 4, but rather by a dedicated IC, connected to the main SoC via PCIe :)

Hence there's two USB 3 ports and two USB 2 ports, but wired completely differently internally! Presumably the USB-C port is connected to the SoC more directly.

If it is all 5 volts, it will not do much. But perhaps that screwball PD stuff would get you in trouble. The OTG stuff, just concerns who is the usb host. Where the otg cable instructs a normally client device to act as a usb host, Where the holy grail was to find that magical OTG cable that would let me charge the phone while it was acting as host. Hmmm... on reflection, this would be any dock right?

And a rant, for free: Holy smokes, I think OTG may be the second most braindead marketing dribble sort of acronym to come out of tech, right behind wifi(wireless... fidelity? what does that even mean?)

Maybe the USB-IF agrees, because OTG is no longer a thing with USB-C.
No need to have a separate USB-A brick - simply have a USB-C brick plus C-to-A adapter. An adapter will force 5V down the port no matter what. But afaik you still need USB-A cable (or another adapter?), which kinda defeats the whole idea of having just one cable.
I guess this is only partially true, as I have a A-to-C charger cable from Huawei that works with everything except my Pixel 4A phone. And my Pixel 4A phone works with everything except that specific cable.
USB A->C cables are supposed to have a Rp pullup on CC1, and leave CC2 disconnected. Huawei made some A->C cables which (incorrectly, and spec-violatingly) have Rp pullups on both CC lines, which is how you signal you're a power sourcing Debug Accessory

Your Pixel 4A is entering debug accessory mode (DebugAccessory.SNK state in the USB-C port state machine); other devices probably don't support debug accessory mode and just shrug.

Maybe the cable is missing the CC pin resistors (all USB-A to C cables are supposed to have them to identify themselves as such), and maybe only the phone cares.
Not related to this exact problem: but also note that the cheapest cables max out at 60W, anything more power needs a new special cable that does its own smarts and communication regarding proving it can handle more power (total nightmare I found, also some computer manufacturers have years of usbc-pd bugs still troubling computer bootups)
could be for safety reason ?, many device with usb c port can be used underwater(smartphone).
It's not a terrible mistake. A terrible mistake would have been having such power available on ports that even a reasonable person might short out by innocently connecting a USB C cable between them.

A couple 5.1k resistors add about $0.00001 to the BOM cost. The terrible mistake is on the designers of devices who try to forego these.

It's really not the BOM cost that drives these decisions but the assembly cost of adding placements. Time on the assembly line is very valuable and doesn't have a simple / clean representation on a spreadsheet. It's dependent on the market and right now assembly line time is worth a lot.
That is exactly the reality. I work in a place where we build HW. The resistor costs almost nothing. But installing it, having it in stock, making sure the quality of yet another component is correct, eventually managing another vendor, all costs. So much, that the cost of a resistor we put a value of some cents (up to ten) even when the part itself cost so little that the software has problems tracking it.
Except that connecting 5V to 5V does not cause a short circuit. No current will flow without a voltage difference. If there is a difference, the capacitors in one of the power supplies will charge up to the same voltage and then current stops flowing again.
That would be true if both sides were exactly 5.0V, but they're not. There's a 5% tolerance, from 4.75V to 5.25V, and in practice you will see chargers often run "5V" at 5.1V intentionally, to account for resistive loss in the charging cable. If you accidentally connect your "5V" device to the host's "5V" you may find that the host simply disables the port, which has happened to me more than once. So no, you can't just blindly connect them together.
Yes you can. They will not blow. Nothing will happen.
What do you mean by "blow"? There's often a polyfuse which will trip, and needs to cool down to reset. I haven't seen a normal fuse but I believe it's possible. Efuses are also common, to allow the system to automatically reset as soon as the fault condition is removed.

It's unlikely that anything will be damaged, but the device likely will not work until the issue is resolved.

They are likely not following the USB spec correctly. Things like pulling certain pins high or low or having a set resistance between certain pins or communications between the host and device will all affect what goes over the wire and whether the host or the device will accept this. Cables will also have some pins entirely unconnected.

Cheap, bad, shortcuts, etc. will result in an out of spec cable being necessary for an out of spec device to work correctly with an in or out of spec hub. It's terrifically frustrating but a fact of the world.

And this isn't just random no name knockoffs. The Raspberry Pi in certain versions didn't correctly follow the power spec. Both the Nintendo Switch and Switch 2 either incompletely, incorrectly, or intentionally abused the USB spec. The Lumen metabolism monitoring device doesn't follow the USB spec. This is one of those things where you want a bit of a walled garden to force users of a technology to adhere to certain rules. Especially when power and charging is involved which can cause fires.

The Nintendo Switch PD charges from every adapter and cable I have tried. However the Switch's power brick itself won't PD charge any other device.
The charger included with the original Nintendo Switch charges my MacBook Pro at 40 watts.
I frequently use the Switch's power brick to charge my Thinkpad, as it's smaller and so easier to transport than the Thinkpad's original power brick.
Me too, I have a tiny 30W PD charger + usb-c cable which is enough for my uses, and about 10% of the size and weight of the 65W power brick.
> This is one of those things where you want a bit of a walled garden to force users of a technology to adhere to certain rules.

That’s what consumer protection laws with teeth and electric safety certifications like CE or UL are for, not walled gardens.

History has shown that relying on hardware DRM, like Apple did with Lightning doesn’t prevent manufacturers, from doing dangerous things, because they’ll find ways around it sooner rather than later.

Some badly designed USB-C devices don’t properly negotiate power supply, and as a result, only USB-A (since these always output 5V without any digital or electrical negotiation) or other non-compliant USB-C devices will actually charge them.
I’ve experienced this too and it’s not just no-names. I have a wireless gaming keyboard from SteelSeries, certainly a very legit brand. I lost the original USB-C cord. Tried every USB-C cord I could find, and they power the keyboard and charge it to exactly 1%, but no more.

Found plenty of people online with the same issue but no resolution.

Finally just paid the $25 to get the OEM SteelSeries replacement cable and it charges fully again. wtf… I guess the replacement cable was USB-A to C and I’ve only tried USB-C to C cables?

That's a big red flag. IF their engineers wont even bother reading the usb-c documents, how can i trust them doing their job right?
Actually, in most situations with this problem it is possible to solder 2 additional resistors inside the offending USB-C device. I have done that on a flashlight and can confirm that it fixed the problem.
Adding SteelSeries to my never buy list, along with Unicomp (Unicomp's literally died on me weeks after the 1 year warranty ended. Got told to buy another at full price, went to Ellipse instead at modelfkeyboards dot com for 4x the price and never been happier).
I've had two Unicomps as my daily drivers since December 2011. No issues so far, other than having to use PS/2 adapters.
I have a JBL speaker with the same issue: it can charge only with the included cable, no other.

They seem to be a popular brand, but can’t even get charging right. Ironically, the speaker doubles as a portable charger.

I have a USB-C JBL speaker (Flip 5) which charges alright with a USB-C to USB-C cable (and USB-C charger), but only in one direction.

So sometimes I have to plug it, realize nothing is happening, unplug, flip the cable and plug it again for it to start charging.

o.O i never knew usb could even do that... honestly some good tip here.. how did u find that out ? i would of never guessed for newer usb this was a thing
They are devices that don't do USB PD. Usually it is a USB-A to USB-C cord, and just provides 5V 500mA or higher.
It’s not really PD. It’s just they aren’t usb c spec compliant at all. USB-C has the power pins at 0v by default, and you have to signal there is a connected device to activate 5v. While usb-a has 5v hot all the time.

Since there aren’t any active chips in these cables, an A to C cable happens to have 5V hot on the usb c side, but this should not be relied on as it isn’t true for C to C

Some are so not USB-C compliant and just "USB-A wires but with a USB-C plug" that they only charge in one orientation just like USB-A.

We can't have nice things.

PD is optional for USB-C devices, but these out of spec devices don’t even support the basic USB-C resistor-based identification scheme (which is mandatory).
I have purchased multiple devices like this over the years. In all cases, it is that it doesn't have whatever circuitry is required to have a USB-C PD charger send 5v down the line. Using a USB A to C cable works every time. Ironically, using a C to A then A to C then makes it work with a USB-C charger.
In order to get anything from a USB-C power supply, a device needs to have 5.1kΩ resistors from the CC1 and CC2 pins of the USB-C port to ground. Devices that cheap out on these two resistors (which cost well under a cent each) will not get any power from the power supply.
Unfortunately this forum is in German but it's really funny:

https://www.mikrocontroller.net/topic/458093

Basically the OP is asking what kind of resistors he needs so that he can get 5V out of USB C.

The first response is "No, 5V is always present." (incorrect)

The second response by another poster is "5V is ALWAYS present at the USB port..."

Only the fourth person actually answers the question and does it in a single sentence: "There needs to be 5k1 between CC and GND."

I've always ignored instructions that say to only use that product's USB cord (things like my kitchen scale and water flossed) and have never had an issue. Sounds like I've just gotten lucky though, based on your experience.

I was under the impression that the USB protocol just fell back to 1a 5v when power negotiation was unsure.

What kinds of devices?

USB-C is 0v by default and you have to signal to get anything at all. A lot of junky devices are non compliant and aren’t set up to signal 5v so they get 0 when plugged in to a C-C cable.
How does it negotiate with a host-powered device if it's unpowered to begin with?
With resistors on the CC pins. In particular, there is resistor value that indicates legacy USB charging. This is in the USB-A to USB-C adapters and cables.

The manufacturers cheaped out in not including the right resistors.

I would also guess that some of these cases are designs that were adapted from previous USB mini- or micro-b configurations. Like an intern got the assignment, switched the connector, and wiped hands on pants, not realizing that an electrical change was required as well.

And if you spin the new board and it works with the A->C cable sitting on your desk, then what could possibly be different about plugging it into a C<->C cable, right?

> How does it negotiate with a host-powered device if it's unpowered to begin with?

Through a pair of resistors.

The unpowered device connects each of the two CC pins to the ground pin through a separate resistor of a specific value. The cable connects one of these CC pins to the corresponding pin on the other end of the cable (the second pin on each side is used to power circuitry within the cable itself, if it's a higher-spec cable). On the host side, each of the two CC pins is connected to the power supply through a separate resistor of another specific value. When you plug all this together, you have the host power supply connected to ground through a pair of resistors, which is a simple voltage divider. When the host detects the resulting voltage on one of the CC pins, it knows there's a device on the other end which is not providing power, and it can connect the main power pins of the connector to its power supply.

This is a real issue.

I have 2 powerbanks that cannot be charged by USB-C port when at 0%. The signaling circuitry simply doesn't work. No idea who designed this. It is silly beyond belief. I have to charge it with normal 5V A-to-C cable for 30 seconds, then unplug, then all the PD stuff will start working and I can fastcharge it with USB-C port again. I'm screwed without A-to-C cable.

Holy shit. This explains why my Anbernic 406v is so weird. If I drain the battery too much, it won't let me charge with anything except with a normal 5v USB A to C cable and the USB-C cable that I use to charge it while it's on does nothing. It makes so much sense now.
This (and the GP) are because your device supports some sort of fast charge USB-PD negotiation, but does not support what is known as “dead battery mode”. Basically, dead battery mode enables those pull down resistors by default (when no power is applied) so you can get 5V to the system, where eventually it would charge up and the chip that can do PD negotiation will be powered. Usually this is done simply by having the negotiation chip default to pull down resistors internally when unpowered.
using passive component
> How does it negotiate with a host-powered device if it's unpowered to begin with?

The spec was written by a SW engineer, this explains some things. /s

Ah that actually makes a lot more sense to start at 0. I appreciate the info.
USB-C hosts and power adapters are only allowed to provide 5V if they can sense a downstream device (either via a network of resistors or via explicit PD negotiation).

Out-of-spec USB-C devices sometimes skip that, and out-of-spec USB-C chargers often (somewhat dangerously) always supply 5V, so the two mistakes sort of cancel out.

Careful. Some of these devices may not be USB-C at all but rather just using the port. If the device calls it USB then it's probably fine to use any cable, but if you just see "Type C", it's safest to assume they don't have it wired up according to any USB standard.
they violate the spec, that's all.