Automate building of HEX files for your nRF Connect SDK application

Note

This guide was originally published on the {DevZone blog.

Continuous delivery is in important aspect of short time to market and since the nRF9160 supports firmware over the air upgrades we want to ship a new firmware to our development boards every time we change the application.

../../_images/github-release-with-hex-files.png

GitHub release with attached HEX files

One precondition for that is the automation of the process that builds the HEX file of an 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.

Note

By default semantic-release will get the reposityUrl it uses to determine the changes between releases from the package.json which after forking the firmware repo will still point to https://github.com/bifravst/firmware.git. Either, update that to the URL of your fork, or provide it as an argument to the semantic-release CLI.

Here is the workflow definition for GitHub Actions which automatically builds HEX files and attaches them to the GitHub release.

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.

../../_images/github-releases.png

GitHub releases