Overview

PHiLIP has been deployed to run HiL (Hardware-in-the-Loop) tests for RIOT OS. The deployment has been running for several years continuously growing and adapting to testing needs. The infrastructure built around the deployment of PHiLIP involves custom built adaption boards, test nodes, multi-platform DUTs and wiring, CI (Continuous Integration) tools, and tests built upon open-source testing frameworks.

Hardware

Test Nodes

A CI Test Node consists of the custom board that provides connections between a Raspberry Pi and PHiLIP and a standard 20 pin ribbon connector to the DUT. This allows for the simple wiring of DUT in different form factors without developing specific breakout boards. A test is provided to ensure wires are correctly routed. The custom board also provides basic power measurement and control tools to help with low power testing, some protection circuitry, and signal conditioning. full test node

Raspberry Pi 3 b+

The raspberry pis are loaded with stock Raspbian image, then updated via ansible:

  • Basic developer packages installed
  • Peripherals configured
  • PHiLIP and raspberry pi specific python packages installed
  • PHiLIP firmware updated
  • Jenkins slave instance installed and configured
  • Credentials and keys added
  • Various flashing software installed
  • Shared copy of RIOT used for flashing configuration installed
  • Robot Framework packages installed

This process is run during initial commissioning and can be executed anytime after to update to the latest state.

Blue Pill Hat

The BPH (Blue Pill Hat) helps with wiring, provides features to help run tests, and increases testing capabilities. The schematics, gerbers and BOMs are all openly available. Designs can easily be altered as the as this is a public project on Circuit Maker. A python CLI tool is also available to simply the interface to the BPH.

bph

The ribbon cable wiring follows this pattern:

BPH Pin Color DUT Pin
1 BLACK DUT_NSS
2 WHITE DUT_SCK
3 GREY DUT_MISO
4 PURPLE DUT_MOSI
5 BLUE DUT_IC
6 GREEN DUT_SCL
7 YELLOW GND
8 ORANGE DUT_SDA
9 RED DUT_RST
10 BROWN DUT_PWM
11 BLACK DUT_CTS
12 WHITE DUT_DAC
13 GREY DUT_RTS
14 PURPLE EXT_V_OUT
15 BLUE DUT_RX
16 GREEN DEBUG2
17 YELLOW DUT_TX
18 ORANGE DEBUG1
19 RED DUT_ADC
20 BROWN DEBUG0

PHiLIP Boards

The PHiLIP board variant used in this deployment is the bluepill board. The bluepill ise STM32F103 based board which can be bought for around 2€ on sides like AliExpress, eBay and others.

There are also versions that only report to have 32 KiB, but actually have 64 KiB.

MCU STM32F103C8
Family ARM Cortex-M3
Vendor STMicroelectronics
RAM 20 KiB
Flash 32 KiB/ 64 KiB / 128 KiB
Frequency up to 72 MHz
Timer 3x 16-Bit
ADC 2x 12-bit, 10 channels
UART 3
SPI 2
I2C 2
CAN 1
Vcc 2.0 to 3.6 V
Datasheet STM32F103C8 Datasheet

RIOT OS DUTs

Tests are run on a growing number of boards covering many different CPUs (AVR, cortex-m0+, cortex-m0, cortex-m3, cortex-m4, cortex-m7, cortex-m23, esp32, esp8266). Two types of test can be run, on-target and PHiLIP-based tests. The on-target tests only require a DUT and exist in the RIOT OS repository. The PHiLIP-based tests require specific wiring to PHiLIP and use Robot-Framework to build the tests. These tests specifically target peripherals and IO such as I2C, SPI, UART, timers, and GPIO.

Racks

Several racks have been filled with test nodes and DUTs. The racks are housed at HAW Hamburg.

rack0 rack1 rackfront2

CI

The CI (Continuous Integration) manages the infrastructure updates, test execution, and serving the test results. This consists of a

Jenkins

Jenkins is open source automation server software. The CI can deploy and preform updates completely code driven, meaning no manual configuration steps are needed. The RIOT HiL Jenkins CI contains a docker image, casc configurations, and dsl scripts to achieve this.

Our Jenkins is responsible for coordinating all the tests and test nodes. This handles adding and accessing new test node, issuing the nightly tests, or allowed specific tests to be run with specific configurations.

Ansible

Ansible is an automation platform that helps manage infrastructure. The deployment uses Ansible to commission and update new test nodes and build servers.

Results Website

The test results are hosted on a custom website, allowing an overview of all the test results and providing plots of metric information