Building the project using Docker

Building using Docker is the simplest way to build the project on your local system. If you install Docker, it will contain all the dependencies in the image, and prevents the need to install them separately in your system.

Note

See Building nRF Connect SDK applications with Docker for more information.

The Docker image is also used to automate the building of HEX files using GitHub Actions, which is used to continuously deliver the firmware builds in the out-of-tree example repository.

To clone the firmware repository, run the following command:

# ~/nrf-asset-tracker

git clone --branch saga --single-branch \
  https://github.com/NordicSemiconductor/asset-tracker-cloud-firmware-azure firmware

If you have not configured the firmware yet, follow the instructions for configuring the firmware.

Then, move the ~/nrf-asset-tracker/firmware.conf file into the ~/nrf-asset-tracker/firmware folder.

# ~/nrf-asset-tracker

mv ~/nrf-asset-tracker/firmware.conf ~/nrf-asset-tracker/firmware/

Build the project

Build the project for your nRF9160-based device using the specified commands.

Thingy:91 (PCA20035)

docker run --rm -v ${PWD}/firmware:/workdir/project nordicplayground/nrfconnect-sdk:main west build -p always -b thingy91_nrf9160_ns --build-dir /workdir/project/build -- -DOVERLAY_CONFIG="overlay-azure.conf;overlay-debug.conf;asset-tracker-cloud-firmware-azure.conf;firmware.conf"
ls -la build/zephyr/merged.hex

nRF9160 DK (PCA10090)

docker run --rm -v ${PWD}/firmware:/workdir/project nordicplayground/nrfconnect-sdk:main west build -p always -b nrf9160dk_nrf9160_ns --build-dir /workdir/project/build -- -DOVERLAY_CONFIG="overlay-azure.conf;overlay-debug.conf;asset-tracker-cloud-firmware-azure.conf;firmware.conf"
ls -la build/zephyr/merged.hex

Location of the HEX file

The built HEX file will be located in build/zephyr/merged.hex.

Device credentials

For the device to be able to connect to the nRF Asset Tracker for Azure, you must create device credentials.