Backend & DevOps

CI/CD for Embedded and Automotive Software (Hardware-in-the-Loop)

A reference pipeline for ECUs, cockpits, robots and drones, with HIL rigs that behave like cloud runners.

3 min read

Electronic circuit boards on a test bench
Photo: Nicolas Thomas on Unsplash

In short

  • CI/CD for embedded software brings automated builds and tests to code that runs on real hardware: ECUs, cockpit computers, robots and drones.
  • The pipeline climbs a ladder: unit tests on a PC, software-in-the-loop in simulation, then hardware-in-the-loop (HIL) on real boards wired to simulated vehicles or machines.
  • The hard parts are the lab: sharing scarce rigs, flashing reliably, and turning flaky hardware tests into trustworthy signals.

CI/CD for embedded software is what lets automotive and robotics teams release often without breaking things they cannot easily fix later. Cloud teams deploy many times a day because every change is tested automatically. Embedded teams face a harder problem: the code must be tested on the actual chip, with the actual sensors and buses, under real timing. This guide explains how mature teams build that pipeline, including hardware-in-the-loop testing.

The testing ladder

LevelWhat runsSpeedWhat it catches
Unit tests on hostCode compiled for a PCSecondsLogic errors
Model-in-the-loop (MIL)Control models in simulationMinutesAlgorithm design errors
Software-in-the-loop (SIL)Production code against simulated environmentMinutesIntegration and behaviour errors
Hardware-in-the-loop (HIL)Real ECU or computer connected to a real-time simulatorMinutes to hoursTiming, drivers, buses, hardware interaction
Vehicle or field testReal car, robot or droneHours to daysEverything else

HIL testing means testing real ECUs in a realistic simulated environment; because the tests are reproducible and automated, they can run around the clock and shorten validation (dSPACE). In the classic V-model, HIL sits between software-in-the-loop and full system integration; the simulator must finish each step within a fixed time, often 0.1 to 1 millisecond for automotive or aerospace (IEEE).

CI/CD for embedded software: a reference pipeline

  1. On every commit: cross-compile for the target, run static analysis (including MISRA rules where required), unit tests on host and coverage.
  2. On every merge request: build the full image (for example with Yocto), run SIL tests in containers, and a short smoke test on one HIL rig.
  3. Nightly: full HIL regression across all rigs and variants, performance and boot-time measurements, long-running stability tests.
  4. Release candidates: extended HIL suites, security scans, signed artefacts and traceability reports for audits.
  5. After release: staged over-the-air rollout with monitoring. See over-the-air updates and R155/R156.

Making the hardware lab CI-friendly

  • Treat rigs as a shared resource. A scheduler queues jobs, locks a rig, flashes it and releases it, like cloud runners.
  • Reliable flashing and power control. Every rig needs remote power cycling and a recovery path when a bad image bricks the board.
  • Capture everything. Serial logs, bus traces, screenshots or video of displays, stored with the build that produced them.
  • Fight flakiness. Track each test’s pass rate over time; quarantine flaky tests and fix the cause (timing, rig wiring, test data) instead of re-running until green.
  • Scale with virtual hardware. Emulators and virtual ECUs run many tests in parallel; save physical rigs for what only hardware can catch.
  • Version the lab. Rig configuration, firmware of test equipment and simulation models are part of the test result. Record them.

What changes in cockpit and infotainment projects

For in-car displays, HIL tests also press buttons and check screens: a robot finger or relay presses a physical control, a camera or frame grabber checks that the display updated, and a bus simulator feeds speed, gear and media signals. With Euro NCAP 2026 rewarding physical controls, these end-to-end checks matter more. See Euro NCAP 2026 HMI rules.

From our work

On one automotive programme, our team met 6 of 6 hard deadlines while supporting quarterly releases (case study). As an automotive HMI development partner, we build in-car infotainment on Android Automotive OS: media apps and sources, Bluetooth, USB, phone projection and companion apps.

Technologies you will meet

AreaTypical tools
CI serversJenkins, GitLab CI, GitHub Actions with self-hosted runners, Zuul
BuildsCMake, Bazel, Yocto/BitBake, Gradle for Android Automotive, Docker build containers
Code qualityclang-tidy, cppcheck, MISRA checkers, SonarQube, coverage with gcov/llvm-cov
Test frameworksGoogleTest, pytest, Robot Framework, Squish for GUI, Espresso on Android
Hardware labsdSPACE and NI HIL systems, Vector CANoe, LAVA, labgrid, programmable power supplies
SimulationQEMU, virtual ECUs, Gazebo or Isaac Sim for robots, CARLA for driving scenarios

The same principles apply to robots and drones: simulate first, then test on real hardware in a controlled lab, then in the field. For robotics simulation, see Gazebo vs Isaac Sim; for the mobile side of delivery, mobile DevOps from commit to App Store.

Frequently asked questions

What is hardware-in-the-loop testing?

Testing real ECUs or computers connected to a real-time simulator of the vehicle or machine around them.

What is the difference between SIL and HIL?

Software-in-the-loop runs production code against a simulation on ordinary computers; HIL uses the real target hardware.

Can hardware tests run in CI?

Yes, with a scheduler that queues jobs, flashes rigs, captures logs and releases rigs automatically.

How do teams handle flaky hardware tests?

Track pass rates per test, quarantine flaky ones and fix root causes such as timing, wiring or test data.

Working on something like this?

Tell us where the product is stuck. We answer with a concrete next step.

Send a few lines about the product, the deadline and the team you have today. A senior engineer replies within two working days.