Segger test automation

Segger test automation

Running automation processes for testing embedded devices is not an easy task. The physical device was not built in mind for automated tests but adopting test automation has many benefits. In this blog post, I’ll review Segger test automation tools that will allow you to implement test automation on the physical device.

Segger’s tools are very popular for development, debugging and analysis of professional embedded systems. Some are GUI based and some are command line based. As we are talking about automating processes we’ll focus on command line tools only. I encourage you to read through Segger’s documentation if you find this post useful.

Let’s go over the three most valuable Segger test automation tools.

ELFLib

The SEGGER ELFLib is a library for extracting various information from ELF files, be it generic ELF related information (e.g. section information), or compiler specific debugging information (e.g. variables/functions, their types, address, …). This tool will get you everything you need to program an ELF file into your target. It allows you to find section, program information and look up symbols.

It comes with simple API, it’s cross-platform (Windows, Linux, macOS) and it supports ELF output from different compilers.

RTT

The SEGGER RTT (Real Time Transfer) is used for interactive user I/O in embedded applications. RTT allows you to output information from the target microcontroller as well as sending input to the application at a very high speed without affecting the target’s real-time behavior.

You can use RTT for example as:

  1. An output for gcov results for test coverage.
  2. Send commands from a testing application to exercise various scenarios on the target device’s firmware.
  3. An output for any information out of the target device (log, debug traces).

Combined with the J-Link SDK you have here a powerful tool for test scripts, meaning test automation and continuous integration.

J-Link SDK

The SEGGER J-Link SDK makes it fast and easy to integrate J-Link support into your own application. For test automation, it means integration with your test runner and test scripts. It’s cross-platform and can be used with nearly every programming language.

This SDK allows you to use the entire functionality of J-Link, for example:

  1. Flash programming
  2. Complete control of the target device – run, halt, reset, etc.
  3. Using RTT

Let’s recap

If you are using Segger in your embedded software R&D process and wondered about Segger test automation, I just covered the basics to get you started (I encourage you to explore Segger’s tools documentation). Use the tools above for automated tests on your target hardware. From here, head to the following links to learn and set up test automation and continuous integration for embedded software:

  1. Moving from manual to automated testing in embedded software.
  2. How to build continuous integration for embedded software.
  3. How to setup STM32 continuous integration (example for the STM32).

Feel free to share your thoughts and test automation recipes with Segger’s tools.