5 tools that help make Python talk to USB

-July 21, 2015

USB development on an embedded system can be a nightmare especially if it is a protocol that the developer doesn’t use every day. While attending Colin O’Flynn’s session “USSSSB: Talking USB from Python" at ESC Silicon Valley this week, I discovered that there are some useful tools that every developer should be aware of, tools that simplify USB development. These five tools are ones I found particularly interesting that were demonstrated as part of Colin's presentation.

Tool #1 – USB View

USB View is a tool that was developed by Microsoft in order to debug USB enumeration issues. While the original USB View was developed for Windows, though, there is also a Linux version available. The tool enables a developer to view all of the devices that are connected to a PC through USB. Each device is displayed as part of a tree and, through navigation, the configuration data for each USB device can be retrieved. A quick overview of how the tool looks can be seen in Figure 1. Links to these tools can be found on the FTDI utilities website located at http://www.ftdichip.com/Support/Utilities.htm.

Figure 1 – USB View

Tool #2 – PyUSB

The cross platform compatibility of Python makes it the perfect programming language to develop USB terminals and application GUI’s. One of the add-on libraries that makes Python a great programming language for interfacing to an embedded system over USB is the PyUSB library. PyUSB provides an easy to use wrapper interface for accessing the open source libusb. Information about this library, how to install and to begin using it can be found at https://walac.github.io/pyusb/.

Tool #3 – PySide

PySide is a useful Python library that exposes Qt UI functions. It can be used to create a graphical user interface from within Python that can then be used to interact with the PyUSB library and ultimately the USB based embedded system. For example, a button could be added that then sends a USB message to turn on an LED or read sensor data can be developed in a matter of minutes. Information about PySide can be found at https://pypi.python.org/pypi/PySide.

Tool #4 – Software protocol analyzers

Any developer who has had the pleasure of developing a USB based embedded system knows that development doesn’t always go smoothly. Undoubtedly there will come a time when either the device won’t enumerate or just strange behavior occurs when attempting to transfer data. There are many different possible issues that can occur such as improper configurations, poor layout, out-of-spec oscillator just to name a few. In order to dig into what is going on a developer can use a software protocol analyzer such as Wireshark to capture the USB data stream that the PC is receiving. Some additional information on USB software protocol analyzers can be found at http://janaxelson.com/development_tools.htm

Tool #5 – Hardware protocol analyzers

A software protocol analyzer is a great tool provided that the PC is able to recognize the USB device. In an event where the USB clock is off and unable to enumerate, though, a software analyzer isn’t going to be very useful for debugging. Fortunately there is also a hardware protocol analyzer available to embedded developers working with USB. One example is the Total Phase Beagle USB protocol analyzer. The Beagle High Speed version costs just a hair over $1000, which is well worth it given the amount of time a debug session could take without the right tools. The Beagle is a hardware protocol analyzer that monitors the bus traffic on the physical pins and is able to not only record but also decode USB traffic in real-time.


Developing a USB based embedded system has always been considered to be a complicated endeavor but it has recently become nearly a trivial endeavor. Silicon vendors are now providing out-of-the-box examples of different USB classes, which leaves developers with the mission of accessing the device from a PC. The PC tools have come a long way, especially with the use of open source libraries and the Python programming language. Now is the time to start building embedded systems using USB and Python and enjoying the development tools that help make developers lives easier.

Jacob Beningo is a Certified Software Development Professional (CSDP) whose expertise is in embedded software. He works with companies to decrease costs and time to market while maintaining a quality and robust product. Feel free to contact him at jacob@beningo.com, at his website www.beningo.com, and sign-up for his monthly Embedded Bytes Newsletter here.

Join over 2,000 technical professionals and embedded systems hardware, software, and firmware developers at ESC Minneapolis Nov 4-5, 2015 and learn about the latest techniques and tips for reducing time, cost, and complexity in the embedded development process.

The Embedded Systems Conference and EDN are owned by UBM Canon.

Loading comments...

Write a Comment

To comment please Log In