Improving USB reliability
Open Hardware – Programmable USB Hub
The Programmable USB Hub promises to resolve common issues with USB reliability in the short term, making way for future open hardware testing and debugging.
Capable Robot Components (CRC) [1] is a company that is only 18 months old. According to founder Chris Osterwood (Figure 1), the goal of the company is "enabling robotic systems to get to market faster by allowing engineers to focus more on application-specific development, instead of building underlying infrastructure. On sites like Hackster.io and Adafruit Industries, CRC has already gained attention with SenseTemp [2], an open hardware precision temperature sensor. More recently, it has been fundraising for the Programmable USB Hub [3], a multipurpose device designed specifically for improving the reliability of embedded devices, but it also includes a variety of other functions.
Osterwood has a decade of experience in robotics companies. "I've designed everything from five-degree of freedom robot manipulators and 3D vision systems to autonomous sewer inspection robots to monocular cameras and autonomous industrial floor scrubbers. I've loved the breadth of electrical and software experience I've had." Much of his experience has involved bug fixing, code contributions, and testing in such projects as CircuitPython, CadQuery, cqparts, and Field Programmable Gate Array (FPGA) development frameworks such as Migen and LiteX. "I've benefited from open source software throughout my professional career," Osterwood says, "and I'm thrilled to be contributing back to the community here at Capable Robot Components."
The idea for the Programmable USB Hub came from Osterwood's own experience with USB in mobile robotic systems, as well as from conversations with roboticists developing warehouse and autonomous picking robots. Osterwood explains that "USB is used in many robotic systems due to the high-bandwidth and the ubiquity of USB on embedded computers and sensors. It's generally faster to initially integrate a USB sensor into a system than an Ethernet-based one, and USB sensors are generally lower cost because they have a lower implementation cost. But USB has poor reliability in industrial and commercial environments, especially over long-term operation. It's relatively common for USB devices to disappear from the bus from time to time, and sometimes they don't come back. I've also seen instances where a USB device fails in a way that prevents other devices on the same USB bus from performing normally – as all bus bandwidth is shared."
A Multipurpose Tool
Primarily, the Programmable USB Hub (Figure 2) is designed to resolve such common issues. Via the hub, unreliable devices can be reset by disconnecting and reconnecting power and/or data flow. A failed device can be removed by disconnecting the data lines. "All this can be done with software controls," Osterwood emphasizes. "No access to the USB ports is needed."
LEDs are mounted on the front of the case to show the state of each of the Hub's four ports. White, green, and blue LEDs tell whether the connected device is operating at high, full, or low speed respectively, while an orange LED means that the power and data lines are disabled for a port, and a red one means that a port has been intentionally turned off. However, these LEDs are simply indicators (Figure 3).
Rather, control of the Hub is through a connected computer. In keeping with its modular design philosophy, the computer's connection to the Hub is a CircuitPython circuit board. Such boards are popular, easy to use, and widely available on sites like Adafruit for under $25, depending on the model. In addition, the use of a CircuitPython board means that the Hub can serve as a development board that can be easily connected to a variety of devices. To aid in this connectivity, the Hub supports both 12V and 24V nominal power input, voltages that are common in embedded devices, as well as rubber bumpers and mounting flanges to aid in customizing different physical hardware configurations.
No matter how the connected hardware is arranged, the board's USB microcontroller (MCU) gives access to the internal Serial Peripheral Interface (SPI) flash memory. The SPI flash contains the operating files that are run on the microcontroller. Because these files are written in Python – and therefore compiled each time they run – they can be edited in any file editor. From a connected computer, devices attached to the Hub can be monitored and controlled individually, with both power and data lines disconnected and reconnected as needed. When the modified files are saved, the microcontroller automatically reboots and starts to use the modified code. "No special flashing software is needed, no special editor, nor special hardware," Osterwood emphasizes. "The zero friction of changing MCU code is one of my favorite features of CircuitPython." Should connected devices include open source Python drivers, which is increasingly common these days in embedded devices, the opportunities for further control become even greater.
As Osterwood notes, the ability to program the Hub "allows for some interesting use cases." For example, enumeration can be delayed so that devices do not immediately come online. Similarly, it allows switching between several identical USB devices. Power and data can also be disconnected automatically if a connected device stops communicating or an error occurs, which helps to ensure that other devices are not affected.
However, these are only the Hub's main features. Among the Hub's other features is the ability to serve as a USB to TTL serial adapter and as a power supply that provides 5V/6A and 13mA resolution monitoring to connected devices. Yet another feature is the power to switch USB data pairs individually, which can be used to emulate the removal and addition of devices entirely through software.
In fact, the Hub's features are so numerous that Osterwood says that "the biggest challenge with [developing the Hub] was integrating all of this functional flexibility into a small device. The numerous high-speed differential pairs must be kept away from noise sources, and that's difficult to do given the amount of power being regulated and distributed in the Hub. Even seemingly easy things like putting connectors and 10 RGB status LEDs on the front and rear panels become an integration challenge when there are so many, especially when trying to minimize trace length and signal coupling."
Osterwood continues, "additionally, there are a few exclusive signal options that I wanted to present to the end user in a clear way. For example, the UART RX/TX pins and the SPI chip select pin on the internal mikroBUS header can be jumpered to either the USB Hub chip or the internal microcontroller – there are valid reasons for both configurations." Similarly, resetting power quickly was a function that was at odds with the Hub's communication with SPI devices and had to be disabled as soon as possible.
But this is only a high-level overview of the Programmable USB Hub. A more technical description of the Hub's engineering is available in a series of Jupyter Notebooks on GitHub [4].
Advance Interest
As I write, the Programmable USB Hub is a few days into its crowdfunding campaign on Crowd Supply. It is already at 70 percent of its modest goal of $10,000, so the campaign seems certain to succeed. At Crowd Supply's Teardown conference in late June 2019, Osterwood found that what excited most attendees about the Hub was the idea of using the Hub to develop and test embedded electronic devices. As Osterwood notes, "flashing, testing, and debugging microcontrollers and embedded processors generally requires a number of different hardware devices to be connected or disconnected at different times. The power and data disconnection of the Hub allow you to automate those changes – instead of physically plugging and unplugging cables."
Another popular use case according to Osterwood is the continuous integration testing of embedded electronics. "The Hub allows power and data to the device under test and device stimulus hardware to be controlled and sequenced as you need. This makes it easy to flash software, power cycle, test, and repeat with different software builds in a completely automated way."
The Programmable USB Hub is unlikely to find its way on to the average user's desktop. However, due to its potential to aid other open hardware development, it seems certain to ensure that a number of other open hardware devices will.
Infos
- Capable Robot Components: https://capablerobot.com/
- SenseTemp: https://www.crowdsupply.com/capable-robot-components/sensetemp
- Programmable USB Hub: https://www.crowdsupply.com/capable-robot-components/programmable-usb-hub
- Technical description on GitHub: https://github.com/CapableRobot/notebooks
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.