From Nordic: Automate building of HEX files for your nRF Connect SDK application using CircleCI or GitHub Actions
Continuous delivery is in important aspect of short time to market and since the nRF9160 supports firmware over the air updates we want to ship a new firmware to our development boards every time we update the application.
One precondition for that is the automation of the process that compiles the HEX file of an application.
In this example I'll provide the configuration for Circle CI, a continuous integration service, which allows you to run task on their service for free, if your project is open source.
After signing up for CircleCI and connecting it to your source code provider, you need to provide a configuration file which instructs the docker-based build system to
- configure the image with the necessary dependencies for Zephyr
- initialize NCS and its dependencies
- build the HEX files for all target devices of your application
Getting all these steps right takes a while, because configuring NCS and Zephyr includes many individual tasks, but afterwards you have a reproducible recipe to build your HEX files, as part of your source code project.
Not only does that mean you can provide up-to-date HEX files with zero effort, but using a CI runner allows you to automate your software releases using a project called semantic release.
This repository contains the
- CircleCI configuration file which builds the HEX files for the application located in applications/cat_tracker
- and uses semantic release to attach these HEX files to GitHub releases.
Following this example, all developers need to do format their commit messages following a certain schema (you can read more in detail about this process here) to trigger a new release.
Using GitHub Actions
GitHub Actions are a new feature which is to be released in November 2019, but many GitHub organizations already are enrolled in the public beta. Like CircleCI it is a generic task runner but offers deeper integration into GitHub.
Here is the workflow definition for GitHub Actions which automatically compiles HEX files and attaches them to the GitHub release.
Looking to integrate Nordic products with your design? Our Applications Engineers offer free design and technical help for your latest designs. Contact us today!
Why partner with Symmetry Electronics? Symmetry's technical staff is specially trained by our suppliers to provide a comprehensive level of technical support. Our in-house Applications Engineers provide free design services to help customers early in the design cycle, providing solutions to save them time, money and frustration. Contact Symmetry for more information.