Main Content

Hardware CI Arena

We develop Electric UI with standardised hardware targets to iterate quickly with common ‘known good’ hardware. During testing on some internal projects, we would occasionally discover differences in device discovery behaviour, connection reliability, and even found a few minor bugs.

Some of these issues were low level, or a result of cross platform differences, but we found some edge cases where USB-Serial adapters behave differently, and the default Arduino bootloader and 16u2 adapter on some AVR boards have some really annoying ‘features’.

We were already continuously testing our embedded library on a Arduino UNO and ATSAMD21 target against a Linux host, but decided to substantially increase our Hardware-in-the-Loop (HitL) tests to build confidence across most common configurations.

Aims
- Test a range of common USB to UART adapters,
- Test the most common microcontroller targets.
- Test the interaction of hardware against our UI on Windows, macOS and Linux OSes.
- Where possible, test hardware/firmware matches real-world settings (manufacturer configurable FTDI options, etc).

When we fleshed these requirements out with a list of adapters and microcontroller architectures (and the number of HAL/RTOS choices per target), the resulting matrix of tests started to look a bit daunting to just hang off the back of the build server…

Enter the Arena
Designed as a way of consolidating the mess of targets hanging off the back of the build server, a custom board opens up the ability to solve a few additional problems:

- Ability to test USB hot plug support,
- Perform low-level tests against specific USB-Serial hardware in loop-back mode,
- Test situations where the UART connection to the microcontroller is broken, or the target is power cycled independently of the USB adapter,
- Dynamic validation of hardware interaction with stimulus and response IO connected to each target.
- The conceptual design is straightforward: provide a USB hub or multiplexer for USB targets, controllable power switches on each adapter and target, and a serial routing matrix to connect adapter serial connections to any of our targets.”

Link to article