APC Australia

More Android USB charging secrets

With new power delivery standards and attacks from malware-embedded USB chargers, Darren Yates reveals how to get your phone charging faster and safer.

-

Batteries are one of the many technology devices we all take for granted — that is, until they go flat, or in the recent case of Samsung’s Galaxy Note 7 smartphone, they’re the subject of a potential safety risk and result in a global product recall. Smartphone­s don’t work without batteries, but as each new generation of phone gets bigger and faster, we’re becoming more impatient, demanding batteries that last longer and charge faster.

A couple of years ago, we took an in-depth look at how Android USB charging works ( tinyurl.com/oe7lmm8). Since then, the landscape has changed considerab­ly to include new power delivery standards and concerns over rogue USB chargers injecting malware into phones — time enough for us to uncover more Android USB charging secrets to share.

THE PROBLEM

While SoCs (system on a chip) continue to become more power-efficient through reduced-scale manufactur­ing, the real problem is the major cost in electrical power draw is still the screen. And as screen sizes continue to grow, battery capacity also has to scale to achieve at least comparable run times to previous smallerscr­eened models.

Back in 2013, researcher­s Aaron Carroll and Gernot Heiser of the University of New South Wales carried out power consumptio­n experiment­s on a Samsung Galaxy S3 smartphone, measuring power usage of various components within the phone ( www.nicta.com.au/pub?doc=7044, PDF). The results showed that whether the phone was idle or playing Angry Birds,

the screen was the most powerdeman­ding component (you had to play a 3D game like Need for Speed before the GPU took over that mantle). Now, as screen sizes have increased, so too have battery capacities. The 3.7-inch HTC Desire, the Android phone to own back in 2010, came with a 1,400milliam­p-per-hour (mAh) Lithium-ion battery. The new 5.5-inch Samsung Galaxy S7 Edge features a 3,600mAh battery — more than two-and-a-half times the capacity. LG’s new mid-range X Power phone packs in an even larger 4,100mAh battery.

While larger batteries are great for run-times, they’re not so great for charge times — unless you employ some radical charging techniques. But unless you’re also aware of how new USB charging specs work, you could be charging your phone at below-optimum rates, or worse, putting your tech in harm’s way.

USB CHARGING STANDARDS

Let’s face it — to many, talking about USB charging standards can be as boring as watching paint dry. But if you’re the type that goes out and buys a $1,300 smartphone, then pairs it up with a cheap charger from a $2 shop, you could be in for a real shock.

Read our original 2014 story online for the basics of USB charging — some sections of that story are still relevant, others are now out of date, hence this update. Just remember that, as a result of continual developmen­t, multiple charging standards now exist for smartphone­s over USB — whether via a PC port or a dedicated AC USB charger.

Going over the basics just briefly, the original USB1.0 standard allowed a device charge rate from a USB port of 150 milliamps (mA). USB2.0 pushed that to 500mA and USB3.0 to 900mA. Eventually, special battery charging specificat­ions arrived to boost the charge current from spec’d-up ports to 1,500mA. The problem was that smartphone­s arrived before the new specificat­ions did and manufactur­ers being an impatient lot, they came up with their own standards involving voltage-level sensing on the D+ and Dlines in the USB wiring. With this technique, Apple created three different charge rates — 500mA, 1,000mA and 2,100mA to suit various iPhones and iPads.

By the time the USB standard caught up, we had two new port specificat­ions — the Charging Downstream Port (CDP) and the Dedicated Charging Port (DCP). Both of these offer charge rates of up to 1,500mA — a CDP also supports data transfer, but a DCP doesn’t. Backwardsc­ompatibili­ty generally ensures safety for devices and charging ports.

ACCELERATE­D CHARGING

Since then, the USB charging landscape has changed dramatical­ly — much of it because battery capacities keep rising. As before, manufactur­ers have taken matters into their own hands and come up with a series of mostly-compatible, non-standard accelerate­d charging technologi­es. Samsung has ‘Adaptive Fast Charging’, HTC sells ‘Rapid Charging’ and Motorola ‘Turbo Charging’.

For the most part, these are based on chipmaker Qualcomm’s ‘Quick Charge’ technology baked into many of its later Snapdragon SoCs, but licensed to other

makers as well. Up until now, USB charging was all about how much current you could suck through a USB cable at a fixed 5VDC voltage level. Qualcomm then thought, ‘What if we jacked up the voltage instead?’ and Quick Charge was born.

Quick Charge 2.0, the standard the others have licensed, supports three voltage rails on ‘Class A’ devices like smartphone­s — 5VDC, 9VDC and 12VDC. Quick Charge-ready charge adapters and phones negotiate the optimum power levels to suit conditions. New Quick Charge 3.0 replaces the three voltage rails with a voltage system that dynamicall­y switches between 3.6V and 20V at 0.2V increments. Qualcomm says charge times can be as much as four-times faster and phones with Snapdragon 430, 617, 618, 620 and 820 SoCs can be Quick Charge 3.0-ready (provided the charger and cable are also spec’d right).

USB3.1 AND USB-C

But it’s the arrival of two new contestant­s — USB3.1 and USB-C — that have blurred the lines more so. Some may suggest to you these two are the same thing — unfollow them immediatel­y. USB3.1 refers to a group of new USB specificat­ions, whereas USB-C, which we’ll insist on calling ‘USB Type-C’ from here on in, is the new reversible USB connector.

USB3.1 has taken over the specificat­ion of USB3.0 to such an extent that USB3.0 is now known as ‘USB3.1 Gen1’ and what we called ‘USB3.1’ is really ‘USB3.1 Gen2’. That’s not confusing at all. USB Type-C connectors are designed to support the USB3.1 family standard of data transfer at up to 10Gbps, as well as support the current USB Power Delivery Rev 2.0 (PD) v1.2 standard.

The USB PD2.0 v1.2 spec is a standard for powering devices over USB and supports four voltage rails of 5, 9, 15 and 20VDC. There was some talk of phone makers looking to see how Power Delivery 2.0 would line up against Qualcomm’s Quick Charge. However, things get tricky around USB Type-C connectors. Google engineer Benson Leung has become something of a champion of USB Type-C and USB3.1 standards and he’s not particular­ly fond of running Quick Charge 2.0/3.0 over USB Type-C. In fact, he cites sub-section 4.8.2 of the Type-C specificat­ion, which declares devices charging over USB cannot “redefine” the “Vbus” USB voltage beyond the USB2.0/3.1 specificat­ions, as to why he believes Quick Charge 2.0/3.0 on USB Type-C violates specificat­ions ( tinyurl.com/h38gcpa). Qualcomm reportedly responded to these concerns with a statement published on AndroidCen­tral, which essentiall­y says that Quick Charge was designed to be connector-independen­t and that manufactur­ers can configure Quick Charge to be within Type-C specificat­ion ( tinyurl.com/jh8mdfv).

Charging your smartphone is not quite as simple as it seems.

THE SILENT KILLERS

But it gets worse. We all have USB2.0 cables by the bushel. However, when it comes to USB Type-C, USB cables become a far more dangerous problem involving what we’d call the ‘silent killers’ — certain USB Type-C to USB Type-A cables that do not meet specificat­ion and could easily blow up USB Type-A ports when charging Type-C devices.

The problem occurs when a USB Type-C device wishes to pull 3,000mA of current from its charging port. If the cable doesn’t include the correct 56kohm pull-up resistor to identify it as a Type-A legacy cable, the device being charged will assume it’s connected to another Type-C port and try to drag 3,000mA of current out of it. Meanwhile, the Type-A port on the other end, which will be lucky to deliver 1,500mA of current downhill with a tailwind, starts gasping for air and eventually blows up under the immense strain.

If you stick to the cable and charger supplied with your USB Type-C device, everything should be sweet. But obviously, if you purchase a USB Type-C to USB Type-A legacy cable to charge from or connect to some other device, such as a PC or notebook USB port, you need to choose carefully to avoid meltdowns. And unfortunat­ely, more than a few non-standard Type-C to Type-A cables have hit the market ( tinyurl.com/hmydg4s).

HOW TO TEST LEGACY TYPE-C CABLES

If you’re concerned about a third-party Type-C to Type-A cable, you can test it yourself if you have a Nexus 6P or 5X smartphone. On a Nexus 6P, plug the Type-C end into your phone, launch a Terminal shell on your phone and enter: cat /sys/class/typec/typec_ device/current_ detect

If the answer comes back ‘2’, the cable is out-of-spec (‘2’ indicates 3,000mA). For Nexus 5X phones, do likewise, but type on the shell: cat /sys/bus/i2c/drivers/ fusb301/*/fclientcur

If you get the answer ‘3,000’, again, the cable isn’t right ( tinyurl.com/

hwj2uym). There’s also a free app on the Google Play store called ‘CheckR’ ( tinyurl.com/zab8kcc), although at time of writing, an update was still to arrive for Android 7.0/Nougat devices and still only worked with the Nexus 5X and 6P phones.

In any case, any phone that’s USB Type-C-compliant should be looking for that 56kohm resistor inside the cable that identifies it as a Type-A legacy cable before setting the maximum charge current appropriat­ely. If that resistor isn’t there or is the wrong value, look out.

NEW USB POWER DELIVERY 3.0

Now aside from Type-C cables, issues have also been detected with some USB Type-C charge adapters. So the USB Implemente­rs Forum (USB-IF) has launched a new certificat­ion program for Type-C chargers. There’s also a new Power Delivery Rev3.0 v1.0a standard ( tinyurl.com/powerdev), which should go a long way to fixing up these issues. According to the USB-IF, PD 3.0 is “functional­ly the same” as PD 2.0 v1.2; however, it will include a new 128-bit cryptograp­hic-based authentica­tion system for both chargers and devices. The new system will allow Type-C devices to authentica­te a Type-C charger’s capabiliti­es and certificat­ion status before any significan­t electrical power changes hands ( tinyurl.com/

jl9g5sp, PDF).

MALWARE CHARGER ATTACKS

The authentica­tion process certainly makes sense. But if you’re wondering why the USB-IF has implemente­d 128-bit encryption in what seems to be little more than a quick handshake between electronic components, it also aims to protect USB Type-C devices against malware attacks from either rogue charge adapters or public charge terminals. The idea is that the encrypted authentica­tion allows phones to implement security to only charge from certified chargers.

HP recently found itself on the wrong side of social media when a new software update blocked some nonauthent­icated third-party printer cartridges ( tinyurl.com/j497suq). Some might argue certified chargers are just another shade of the HP issue. However, the need to protect not just against out-of-spec electronic­s but malwared chargers as well all but makes it a necessity.

And this isn’t a pie-in-the-sky kind of problem either — the malware-riddled USB charger concept has been around since at least 2013, when researcher­s from the Georgia Institute of Technology first unveiled the ‘Mactans’ proof-of-concept malware charger ( tinyurl.com/ny5l64c). At the time, it was a big deal for iOS because no jailbreak was required — the hack happened automatica­lly as soon as the fake USB charger was connected, there were no obvious signs your phone was being hacked and it could make a real mess of your phone and your privacy ( tinyurl.

com/jpusr3n, PDF). Further, the concept of public charge stations injecting malware has been around since 2011.

JUICE JACKING

The technique has since been dubbed ‘juice jacking’ and essentiall­y relies on the fact that a USB peripheral device comes with firmware that a computer is required to run when the device is first plugged in so that the computer knows what it is and what to do with it. Hacked firmware could allow the USB device to attack the host and inject malware to gain personal data. A USB charger with hidden USB firmware could try to initiate an attack on a phone through this channel. The first ‘BadUSB’ device was shown at the Black Hat USA conference in 2014. BadUSB2.0 appeared earlier this year ( tinyurl.com/jctmb3j). Both Apple and Android have since introduced mitigation steps to prevent such attacks, but when it comes to malware, nothing appears future-proof.

Right now, peripheral chip makers have begun launching new USB PD3.0ready controller chips, such as Cypress Semiconduc­tor’s EZ-PD CCG3 — we think this means PD3.0-ready phones will begin appearing during the second-half of 2017 ( tinyurl.com/ jrgd78y).

DO YOUR HOMEWORK

Pretty much all of us have needed a second charger or cable for a phone or tablet at some point. But now with USB Type-C, there’s a much greater need to do your homework before you buy. The new Power Delivery 3.0 standard should go a long way to solving issues, but we could be a while away before PD3.0-ready phones and chargers arrive. With an almost dizzying number of power standards now available, correctly matching chargers and phones is becoming more complex.

USB charging standards aren’t the most exciting tech news you’ll read all day, but next time you come across a dodgy cable or charger, we bet you’ll be glad you did.

 ??  ?? Beware, not all Type-C to Type-A USB cables are within specificat­ions. Google’s own Type-C charger for its new Pixel and Pixel XL phones.
Beware, not all Type-C to Type-A USB cables are within specificat­ions. Google’s own Type-C charger for its new Pixel and Pixel XL phones.
 ??  ??
 ??  ?? The Galaxy S3 screen dominates power draw at idle. (Source: Aaron Carroll)
The Galaxy S3 screen dominates power draw at idle. (Source: Aaron Carroll)
 ??  ?? The Galaxy S7 Edge packs in a 3,600mAh Lithium-ion battery.
The Galaxy S7 Edge packs in a 3,600mAh Lithium-ion battery.
 ??  ?? The USB charge adapter supplied with your phone is always a safe bet.
The USB charge adapter supplied with your phone is always a safe bet.
 ??  ?? Stick to known brands when buying third-party chargers.
Stick to known brands when buying third-party chargers.
 ??  ?? LG’s new X Power packs in a whopping 4,100mAh battery inside.
LG’s new X Power packs in a whopping 4,100mAh battery inside.
 ??  ?? Galaxy S3 power draw during gaming. (Source: Aaron Carroll)
Galaxy S3 power draw during gaming. (Source: Aaron Carroll)
 ??  ?? Samsung’s Galaxy Note 7 knows a thing or two about batteries...
Samsung’s Galaxy Note 7 knows a thing or two about batteries...
 ??  ?? Inline USB volts-amps meters can show power draw from USB ports.
Inline USB volts-amps meters can show power draw from USB ports.
 ??  ?? The USB-IF is setting up a USB charger certificat­ion program.
The USB-IF is setting up a USB charger certificat­ion program.

Newspapers in English

Newspapers from Australia