Original Link: https://www.anandtech.com/show/10163/usb-flash-drives-power-consumption-measurement-using-plugables-usbctkey
USB Flash Drives - Power Consumption Measurement using Plugable's USBC-TKEY
by Ganesh T S on March 18, 2016 9:10 AM EST- Posted in
- Gadgets
- Flash Drive
- DAS
- USB-C
- Plugable
The power consumed by USB peripherals such as flash drives has typically not been much of a concern. However, with OTG support on the rise, mounting external storage via USB on mobile devices has become a common use-case. The power consumed by bus-powered devices is arguably more important compared to the performance numbers in such cases. A reader comment in our recent review of the Samsung Portable SSD T3 piqued our interest, and we set out to quantitatively measure this aspect. This article deals with some background on inline USB power measurement and our available options. This is followed by a detailed description of our hardware setup and the software infrastructure to gather the required data. In the final section, we look at some results from our evaluation of the power consumption of different flash drives followed by some concluding remarks.
Introduction
The measurement of the power consumed by USB peripherals is conceptually a simple affair. DIY solutions are also possible. Devices such as PortPilot offer a professional alternative for inline power measurement while adding management and diagnostic features. There are plenty of other inline USB power measurement gadgets, but none of them are suitable for Type-C / USB 3.1 ports.
The Chromium Twinkie USB-PD Sniffer is one of the most famous Type-C diagnostic kits, thanks to its use by Benson Leung in evaluating adherence of various Type-C cables and adapters to the specifications. Google doesn't sell Twinkie directly to end-users, but interested consumers can get the version manufactured by Plugable - the USB 3.1 Type-C Power Delivery Sniffer (USBC-TKEY).
The Twinkie / USBC-TKEY is primarily intended for developers to monitor the power delivery traffic between two USB Type-C devices. However, it has additional capabilities such as the monitoring of the VBUS and VCONN voltages and currents, injecting power delivery packets on the CC1 and CC2 pins and placing Rd/Rp/Ra resistors on CC1 and CC2. Since it is also designed to be a transparent interposer, it doesn't interfere with the data traffic between the host and the device.
The various pins on a USB 3.1 Type-C plug are brought out in the picture below
From a power measurement perspective, the interesting ones are the VBUS and VCONN. The VBUS line carries bus power for devices (and, in some cases, for the circuitry in the cable itself). The voltage may vary from 5V for typical USB 2.0 hosts / devices to up to 20V for USB-PD scenarios. VCONN, on the other hand, is always set to 5V and can supply up to 1W of power for circuits within the plug. These circuits can implement electronically marked cables or even be accessories.
Coming back to our original intent of measuring the power consumed by USB peripherals such as flash drives, it is obvious that we need to be measuring the voltage and current on the VBUS line. This aspect has suddenly become something to care about because of the number of mobile devices supporting 'OTG'. Not all mobile devices are able to provide the 900 mA output current to 'bus-power' attached devices. Note that the initial specification for USB only had provisions for 0.75 watts of power – 150 mA at 5 V. USB 2.0 bumped that to 500 mA, or 2.5 watts, and USB 3.0 specified 900 mA at 5 V, or 4.5 watts. Understanding the power consumption profile of a flash drive is essential to determine whether it can be safely used with a particular mobile device. It can also help in understanding the impact of usage on the battery life of a mobile device. From a technical viewpoint, it also gives insight into the efficiency of the USB peripheral itself.
Hardware Setup and Software Aspects
Plugable's USBC-TKEY comes in a simple package with multiple cables, but, for our purpose, we only need the main unit and the USB 2.0 Micro-B to Type-A cable. The gallery below shows the package contents and a few close-up shots of the main unit. Note that the main unit comes with a Type-C male connector to link up to the host port and a Type-C female connector to attach the device to. In addition, there is a micro-USB 2.0 connector on the side which enables the USBC-TKEY to communicate the sniffed data to another system for further analysis.
The host device used as the 'test system' was our Skylake DAS Testbed (specifications outlined below).
AnandTech DAS Testbed Configuration | |
Motherboard | GIGABYTE Z170X-UD5 TH ATX |
CPU | Intel Core i5-6600K |
Memory | G.Skill Ripjaws 4 F4-2133C15-8GRR 32 GB ( 4x 8GB) DDR4-2133 @ 15-15-15-35 |
OS Drive | Samsung SM951 MZVPV256 NVMe 256 GB |
SATA Devices | Corsair Neutron XT SSD 480 GB Intel SSD 730 Series 480 GB |
Add-on Card | None |
Chassis | Cooler Master HAF XB EVO |
PSU | Cooler Master V750 750 W |
OS | Windows 10 Pro x64 |
Thanks to Cooler Master, GIGABYTE, G.Skill and Intel for the build components |
The USBC-TKEY was plugged into one of the Thunderbolt 3 / USB 3.1 Gen 2 Type-C ports enabled by the Alpine Ridge controller. While the USBC-TKEY acts as a transparent interposer for the host's port, it needs to be connected to a Ubuntu system for data gathering purposes via its micro-USB port. We chose the ECS LIVA Core (one of the low power PCs at our disposal) and installed Kubuntu 15.10 on it. Plugable's documentation indicates proper support for Ubuntu 14.04 only and advises the use of a USB 2.0 port on the data gathering machine. However, we had no trouble connecting the kit to a USB 3.0 port on a ECS LIVA Core running Kubuntu 15.10.
Plugable's documentation for the USBC-TKEY mostly deals with the capture and viewing of the power delivery packets being exchanged over the interposer [ Update: New documentation for the advanced features of the USBC-TKEY is now available on Plugable's website. It also provides a step-by-step guide to enable the serial console - a process described below in brief ]. However, our requirements were a bit different. Google's Twinkie documentation came to our rescue. Once the interposer link became active (i.e, device was connected to the USBC-TKEY so that it could communicate with the host), the USBC-TKEY itself became visible on the Kubuntu machine. Executing a 'modprobe usbserial' enabled a serial console for the device. There are multiple ways to access this serial console (/dev/ttyUSB0 in our case), but, for a quick check to make sure everything was up and running normally, we used 'screen'. Out of the various commands available, the 'twinkie vbus' provided us the required information.
A little bit of Python scripting using the 'serial' module enabled the creation of a CSV file with the vbus parameters (and, hence, the power consumed by the USB peripheral) sampled at pre-configured time intervals. The CSV file could then be fed to external tools / scripts to generate a graph of the power delivered through the interposer as a function of time.
USBC-TKEY in Action
The power consumed by various USB flash drives was measured under multiple scenarios. These scenarios were triggered using CrystalDiskMark 5.1.2 x64 with a 8GB test file and each test separated by a 10s interval. Flash drives typically come under two broad categories - one with a native USB controller, and the other with a SATA drive talking to the host through a SATA - USB bridge. As an example of the former category, we put the Mushkin Atom 128GB version under the scanner. For the second category, we evaluated the Samsung Portable SSD T3 along with a host of other samples.
The initial part of the graphs below show the idle power consumption of the drive. This is followed by the power consumed when CrystalDiskMark prepares the 8GB test file on the drive. The eight distinct segments that follow show the power consumption profile for the workloads (single-threaded sequential and random accesses with a queue depth of 32, followed by sequential and random accesses with a queue depth of 1). The first four segments correspond to read accesses and the last four to write accesses.
Native USB flash controllers are very power efficient, but, that obviously comes at the cost of performance (numbers that can be seen in the review of the drive). We see that the Mushkin Atom 128GB version idles at around 170 mW and has a peak power consumption of only 1.22 W. On the other hand, using a mSATA SSD and adding a SATA-USB bridge is quite punishing. For the Samsung Portable SSD T3, the idle number moves up to around 290 mW, while the peak is around 3.34 W.
The graphs below compare the power consumption of various drives we tested under different scenarios. The Mushkin Ventura Ultra 120GB (based on a SandForce SF2281 SSD connected through a USB 3.0 - SATA bridge) is the worst when it comes to power consumption (flash drives based on SF2281 are notorious for overheating and throttling). As expected, getting rid of the bridge and going native helps the Mushkin Atom 128GB to be the most power efficient in the tested lot.
Concluding Remarks
The Chromium Twinkie / Plugable USBC-TKEY is an invaluable tool for device developers looking to debug their USB Type-C hardware. As we showed in this article, it also enables us to gain key insight into the power consumption profile of USB peripherals. We tested out various USB flash drives, and that yielded interesting, albeit, expected results.
All our tests used either USB 3.0 Type-A (with a Type-A to Type-C USB 3.1 adapter cable) or USB 3.1 Gen 1 Type-C devices. Since the USBC-TKEY is designed to be transparent to the host and device, and is fully compatible with USB 3.1 specifications, we don't expect any issues with measuring power consumed by USB 3.1 Gen 2 or Thunderbolt 3 peripherals (since Thunderbolt 3 also utilizes USB power delivery). The Plugable USBC-TKEY will enable us to add yet another evaluation point to our comprehensive direct-attached storage testing process.