Test Hardware

Here is information about hardware that is useful for testing embedded Linux systems. This page is intended to be a collecting point for hardware that people have found useful in their own testing, or in board farms.

= Test Configurations = A "device under test" (DUT) is the hardware to be tested. This is usually a development board, when the product is under development, but it can be a finished product as well. There are a large variety of ways to connect with, control and communicate with the DUT.

Here are some sample configurations that are common:

simple network connection to host, with local power and peripherals
In the simplest case, a "device under test" (DUT) will only be "connected" to a host machine with a network connection, and will have it's own power and local peripherals (such as local USB keyboard and/or mouse) and some display output (usually microHDMI).

This allows for testing and debugging the board using network tools (usually scp and ssh) to copy files to and from the target, and to execute commands on the target.

This simple configuration does not provide for serial console support or power control of the board.

connection to host, with serial console
A slightly more advanced configuration consists of local peripherals and power, but with network connection and a serial console connection to the host.

This consists of:
 * network connection to host
 * serial console connection to host:
 * often provided by serial port on DUT with serial-to-USB cable connecting to USB on the host device
 * sometimes (increasingly) the DUT has an on-board serial-to-USB chip. So the DUT provides a micro-USB connection, and all that is required by the user is a standard micro-USB cable.

So, usually this only requires a single extra cable (either serial-to-USB or a standard micro-USB cable) between the DUT and the host.

power control
For some tests, or to recover from some testing failures (ie machine hang) it is important to be able to power-cycle the DUT. A third level of complexity is to support power control for a board. The easiest way to do this is with an network-controlled power switch. This allows turning the A/C power off and on at the wall-wart, for development boards or devices that are powered from a mains circuit.

For battery-powered or USB-powered devices, it may be more complicated. Many boards provide a reboot or reset capability with buttons on the board. Some phones require complex button combinations, holds or sequences to reboot the device. For these, it is necessary to use switch control hardware. You can use hook pins to short-circuit the button connections, or re-wire the electrical connections on a power supply, power cable or board, to allow for relay or switch control of power to the board.

Additional hardware connections
Additional hardware connections to the DUT may be accessed, monitored, or controlled during a test. For example, for USB testing it may be useful to automatically connect and disconnect USB buses. This can be done with specialized hardware, or with broken-out wiring control of certain signal or power lines in a cable. Another example is simulating inserting or removing removable media by controlling certain lines in the bus to the peripheral connectors for a device.

= Test hardware =

Power control
Here are some devices that are handy for controlling power to DUTs, from a host machine:
 * Web-controlled power control module - https://www.digital-loggers.com/lpc.html
 * USB-controlled power switch - http://www.pwrusb.com/powerUSB-basic.html
 * Sony_Debug_Assist_board

Console access
Linux can be configured to provide console access to a device over it's serial port. You can use a NULL-modem cable to connect from your host to the DUT, if you have a serial port on your host. This is now uncommon, with serial, parallel, keyboard and mouse ports now being replaced by USB ports on most desktop and laptop computers. The more common approach is to use a serial-to-USB cable.

A common challenge for serial cables, is making sure you get one that senses the correct voltage for your board. The UART on a development board will usually work at one of 3 voltage levels: 5v, 3.3v or 1.8v. You need to get the correct cable for the UART voltage for your board, as well as the correct cable end-connector. Some boards have RS232 9-pin connectors (often with only 3 lines actually connected), while other boards have pins that you can connect to using female pin connectors from the cable.


 * USB to serial cables
 * Digi-Key listing for an FTDI cable that will work with the Raspberry Pi board
 * Adafruit listing for an FTDI Serial TTL-232 USB Cable

Switch control/Relays

 * Target Switch Control From Parallel Port - circuit schematics for building your own opto-isolated switches controlled by host parallel port
 * This was more useful when most desktop machines had parallel ports as standard hardware
 * web-control relays
 * ControlByWeb has some nice models that are easy to use: http://www.controlbyweb.com/webrelay/ (they are kind of pricey, though)

It is fairly common for people to put together relay control solutions using a cheap control board and a daughter board with the actual relays. Here are some examples. Note that control of the relays from your test host is left as an exercise to the reader.


 * arduino-controlled relays
 * You can build your own relay control boards, controllable from a host, using an arduino board and a relay control board
 * See http://www.hobbyist.co.nz/?q=interfacing-relay-modules-to-arduino for instructions
 * beagle-bone controlled relays
 * Here's a beaglebone cape with relays: https://www.logicsupply.com/cbb-relay/
 * raspberry-pi controlled relays
 * relay daughter-board for raspberry pi, from Seeed Studio: https://www.seeedstudio.com/Raspberry-Pi-Relay-Board-v1.0-p-2409.html

You could also control a relay from a USB port on the host.
 * see https://numato.com/8-channel-usb-relay-module/
 * see https://www.controlanything.com/Relay/Relay/USB_Relay (more expensive)
 * or: http://www.miniinthebox.com/usb-relay-module-smart-control-switch_p3101643.html (single relay)

Network access
Most boards connect to the test network or the Internet via standard networking cables and protocols (ethernet, 802.11 wifi, etc.)

USB control/switching

 * Sony Debug Assist board - this board allows connecting and disconnecting USB, as well as switching between multiple USB inputs
 * For example, it allows you to have a USB charger, a connection to a USB host, and a USB gadget connection, and switch between them.

USB hubs
Small USB hubs (4-port or 7-port) are quite common and inexpensive.

When building a board farm, it is common to need multi-port hubs.
 * Anyone have a recommendation?

= Multi-function control boards =
 * Sony Debug Assist board - this board has several test and control functions integrated in a single package
 * USB control and switching
 * power control, including voltage and amperage control
 * power measurement
 * switch control - controls up to 3 switches on the DUT
 * serial console - has a serial-to-USB feature, with auto-voltage leveling
 * BayLibre ACME - is a cape and set of probes that support power control and measurement of DUT
 * see http://baylibre.com/acme/

= Presentations = Here are some presentations with information about test hardware (particularly for board farms), and issues related to such hardware:
 * [[Media:Herd_Your_Boards.pdf|Herd Your Boards, Become a Farmer]] by Geert Uytterhoeven, Glider bvba
 * [[Media:Automated_Testing_Laboratory_for_Embedded_Linux_Distributions.pdf|Automated Testing Laboratory for Embedded Linux Distributions (PDF)]] - by Pawel Wieczorek, Samsung R&D Institute Poland
 * [[Media:Building_a_Bards_Farm.pdf|Building a Board Farm: Continuous Integration and Remote Control (PDF)]] - by Antoine Tenart & Quentin Schulz, Free Electrons