Setting up automated firmware builds

Close up photo of an embedded device

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

More often than not, we find that customers do not trust their firmware releases because firmware builds require some tribal knowledge to make changes, such as how to get it working on your machine. At best, there’s a build machine in the corner of the room. We believe this needs to change. A CI pipeline automatically compiles, analyzes, and tests releases, and the output files and reports can be distributed accordingly when code changes are pushed to the source control provider.

Ways to set up an embedded CI pipeline

YAML file

Most of the existing CI tools require some kind of YAML file to kick off the CI pipeline. If you have your repository on GitLab, you can kick off the GitLab built-in CI pipeline by adding a .gitlab-ci.yml file in your repository with a GitLab Runner running. GitLab Runner is an application used by GitLab to process builds. If your repository is on Bitbucket, you will need to use a third party CI tool such as Bamboo and add a bitbucket-pipelines.yml file in your repository.

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 compiler, run Makefile, etc. to build your firmware, create and save the output as an artifact that you can use to flash your device. On Docker hub, you can find some existing Docker image with compiler installed such as gcc:latest.

Virtual Machine

Now, to make things more complicated, your repository is on Bitbucket and it is an IAR project. IAR Embedded Workbench only runs on Windows and the Bitbucket Pipeline currently does not support building Windows application. Also, there is an amount of complexity to install the IAR Embedded Workbench in a Docker container.

Scratching your head trying to figure out how to do it? We got your back and here is how you implement it. You could make use of the repository mirroring feature provided by GitLab to mirror your Bitbucket repository to GitLab to use their built-in CI pipeline. First of all, a Windows instance on Amazon EC2 is needed to run the GitLab Runner and have a licensed IAR Embedded Workbench installed on the instance. Then, you can follow this link to mirror your Bitbucket repository to GitLab.

Remember to include a .gitlab-ci.yml file in your repository.


It might take you a couple of days to research the way to implement the CI pipeline and then spend a couple more days to learn how to mirror your Bitbucket repository. Once it got mirrored successfully, you found out that the CI pipeline is not ready because you forgot to include the .gitlab-ci.yml file in your Bitbucket repository or the GitLab Runner is not set up correctly.

Setting up a CI pipeline can be time consuming and   frustrating, but we can help.

Check out our services    |    Check out our Emedded CI Platform

Or contact us at [email protected]

One thought on “Setting up automated firmware builds

Leave a Reply

Your email address will not be published. Required fields are marked *