Setting Up Automated Firmware Builds

Automated Firmware Builds

Why do you need automated firmware builds (sometimes called a Continuous Integration (CI) pipeline) for your embedded project?

Oftentimes we have found  that customers do not trust their firmware release process because their firmware builds require some tribal knowledge. It can be a challenge to set up machines to produce consistent builds across an entire team, and may even require expensive dongles to get working. Occasionally there’s a build machine in the corner of the room which can help, but is still less than ideal. A CI pipeline automatically compiles, analyzes, and tests releases, while allowing output files and reports to be distributed accordingly. All of this can be triggered simply without user intervention when code changes are pushed to the source control provider.

Book a Call with Dojo Five Embedded Experts

Ways to set up an embedded CI pipeline

YAML file

Most existing CI tools require some kind of YAML config file to kick off the CI pipeline. If you have your repository on GitLab, you can get started with GitLabs’ built-in CI pipeline by adding a .gitlab-ci.yml file in your repository. Next you will need a Gitlab Runner which is an application used by GitLab to process builds. If you instead use Bitbucket, they also have built in CI/CD pipelines that you may leverage. You will just need to include a bitbucket-pipelines.yml file in your repository and set up a Runner application.

Docker image

By adopting Docker image in your CI workflow, in other words, using the image in the YAML file, it creates an environment for you to build your firmware. In the Docker container, you can install the compiler, run make, etc. This allows for you to build your firmware, create and save the output as an artifact that you can use to flash your device consistently across multiple different host machines. On Docker hub, you can find some existing Docker images with a compiler installed such as gcc:latest.

Remote Virtual Machines

Now, for a more complicated scenario. Picture your repository is hosted on Bitbucket and it is an IAR based project. You have engineers working remotely from all over the world. IAR Embedded Workbench only runs on Windows which would add additional complexity when installing the IAR Embedded Workbench in a Docker container. Not to mention IAR licenses are expensive!

So how can we get around these constraints? One option is to leverage virtual machines like those available on Amazon EC2. For the CI Runner, BitBucket offers self-hosted runner applications that may be installed on many windows environments. Once you have a valid Windows instance and Runner setup, you just need an IAR license installed and you will be ready to start using your new pipeline. Just don’t forget to include a .gitlab-ci.yml file in your repository!

Summary

While setting up a CI pipeline can be time consuming and frustrating, the benefits can be seen almost immediately! No more worrying about differences between build machines, no more reliance on tribal knowledge, and peace of mind from continuous testing across releases. If you need help getting started with your CI pipeline, we would love to hear from you! You can book a call with us to start the conversation. We have tools and experience to help you along the way.

Discover why Dojo Five EmbedOps is the embedded enterprise choice for build tool and test management.

Sign up to receive a free account to the EmbedOps platform and start building with confidence..

  • Connect a repo
  • Use Dev Containers with your Continuous Integration (CI) provider
  • Analyze memory usage
  • Integrate and visualize static analysis results
  • Perform Hardware-in-the-Loop (HIL) tests
  • Install the Command Line Interface for a developer-friendly experience

Subscribe to our Monthly Newsletter

Subscribe to our monthly newsletter for development insights delivered straight to your inbox.

Interested in learning more?

Best-in-class embedded firmware content, resources and best practices

Laptop with some code on screen

I want to write my first embedded program. Where do I start?

The boom in the Internet of Things (IoT) commercial devices and hobbyist platforms like the Raspberry Pi and Arduino have created a lot of options, offering inexpensive platforms with easy to use development tools for creating embedded projects. You have a lot of options to choose from. An embedded development platform is typically a microcontroller chip mounted on a circuit board designed to show off its features. There are typically two types out there: there are inexpensive versions, sometimes called

Read More »
Medical device monitoring vitals

IEC-62304 Medical Device Software – Software Life Cycle Processes Primer – Part 1

IEC-62304 Software Lifecycle requires a lot of self-reflection to scrutinize and document your development processes. There is an endless pursuit of perfection when it comes to heavily regulated industries. How can you guarantee something will have zero defects? That’s a pretty hefty task. The regulatory approach for the medical device industry is process control. The concept essentially states that if you document how every step must be completed, and provide checks to show every step has been completed properly, you

Read More »
Operating room filled with medical devices

IEC-62304 Medical Device Software – Software Life Cycle Processes Primer – Part II

Part I provides some background to IEC-62304. Part II provides a slightly more in-depth look at some of the specifics. The IEC 62304 Medical Device Software – Software Lifecycle Processes looks into your development processes for creating and maintaining your software. The standard is available for purchase here. So what activities does the standard look at? Here are some of the major topics. For any given topic, there will be a lot more specifics. This will look at a few

Read More »