Google is one of the early adopters of USB Type-C and USB Power Delivery in their Chromium projects. Interestingly, Google shared the complete design of the USB Type-C products in the public domain, from the schematic to source code of their implementations. This article explores how to use USB C-Thru board to explore Google’s designs, thereby helping you to develop custom design of your own.
This article shows you how to make your own Google USB-PD Sniffer, a.k.a. “Twinkie”, using the USB C-Thru and a STM32 development board ($65.00 USD) in three steps.
Figure 1: List of USB Type-C design examples from Chromium website
In this exercise we’ll explore the “USB Type-C debug dongle and sniffer for USB-PD communications” project. (The USB PD Sniffer tool is also known as Twinkie.)
Check out the complete Twinkie setup guide.
Order an STM32F072 Discovery kit, which is the base platform used by Twinkie.
Generate the binary file “twinkie.bin” and flash it to the STM32 Discovery kit using the “dfu-utils” host utility, as described in Chromium website.
Now that you’ve set up the necessary software and flashed the board with firmware, let’s explore how to set up the hardware to build a Twinkie.
Download the Twinkie schematic “810-10114-04_sch.pdf”.
When you analyze the schematic you’ll see that pins PA1 and PA3 are used to sniff the CC data, as shown in Figure -2 below:
Figure 2: Schematic of Twinkie indicating CC pins
Figure 3: Schematic of Twinkie indicating CC pins
This setup gives you enough of the Twinkie functionality to act as a USB PD sniffer.
With the USB C-thru board and the STM32 discovery board set up and connected, the sniffer is ready to deploy for debugging. In the example setup, we are using a laptop with a USB Type-C charger and USB-C Thru-based sniffer connected to an Ubuntu PC.
Figure 4: Enumeration of STM32 development board as Twinkie device
Figure 5: Google’s USB Type-C example design Twinkie implementation using USB C-thru and STM32
This article provided a quick walk-through of how to use USB C-Thru board with an existing development kit, demonstrating how to make your own USB Type-C experimental design. You can explore other Chromium USB Type-C design examples in similar manner with a few wire wrapped electronics.
Order your USB C-thru today, and feel free to write us for any clarification at email@example.com.