Configuring and building with nRF91 Series

Configuring and building application for the nRF91 Series devices follows the processes described in the Configuring and building an application section, with several exceptions specific to the nRF91 Series that are listed below.

nRF9160 DK board revisions

nRF9160 DK v0.13.0 and earlier are missing the following hardware features that are available on later versions of the DK:

  • External flash memory

  • I/O expander

To build without these features, specify the board revision when building your application.

Note

If you do not specify a board revision, the firmware is built for the default revision (v0.14.0).

To specify the board revision, append it to the board argument when building. The board revision is printed on the label of your DK, just below the PCA number. For example, when building a non-secure application for nRF9160 DK v0.9.0, use nrf9160dk@0.9.0/nrf9160/ns as build target.

See Zephyr’s Building for a board revision and Additional hardware in v0.14.0+ pages for more information.

FOTA updates

You can update the firmware of the device over the air, thus without a wired connection. Such an update is called a FOTA (firmware over-the-air) update. You can use FOTA updates to apply delta patches to the LTE modem firmware, full LTE modem firmware updates, and to replace the upgradable bootloader or the application.

Note

Even though the Trusted Firmware-M and the application are two individually compiled components, they are treated as a single binary blob in the context of firmware updates. Any reference to the application in this section is meant to indicate the application including the Trusted Firmware-M.

To perform a FOTA update, complete the following steps:

  1. Make sure that your application supports FOTA updates.

    To download and apply FOTA updates, your application must use the FOTA download library. This library determines the type of update by inspecting the header of the firmware and invokes the DFU target library to apply the firmware update. In its default configuration, the DFU target library is set to support all the types of FOTA updates except full modem firmware updates, but you can freely enable or disable the support for specific targets. In addition, the following requirements apply:

    • To upgrade the application, you must use Introduction to MCUboot as the upgradable bootloader (CONFIG_BOOTLOADER_MCUBOOT must be enabled).

    • If you want to upgrade the upgradable bootloader, you must use the nRF Secure Immutable Bootloader (CONFIG_SECURE_BOOT must be enabled).

    • If you want to update the modem firmware through modem delta updates, you do not need to use MCUboot or the immutable bootloader, because the modem firmware update is handled by the modem itself.

    • If you want to perform a full modem firmware update, an external flash memory with minimum 4 MB is required.

  2. Create a binary file that contains the new image.

    Note

    This step does not apply for updates of the modem firmware. You can download delta patches and full binaries of the modem firmware from the nRF9161 product website (compatible downloads) or nRF9160 product website (compatible downloads), depending on the SiP you are using.

    To create a binary file for an application update, build the application with the CONFIG_BOOTLOADER_MCUBOOT option enabled. The app_update.bin file must be uploaded to the server.

    To create binary files for a bootloader upgrade, make sure that the Kconfig options CONFIG_SECURE_BOOT and CONFIG_BUILD_S1_VARIANT are enabled and build MCUboot as usual. The build will create a binary file for each variant of the upgradable bootloader, one for each bootloader slot. See Second-stage upgradable bootloader for more information.

  3. Make the binary file (or files) available for download. Upload the serialized .cbor binary file or files to a web server that is compatible with the Download client library.

The full FOTA procedure depends on where the binary files are hosted for download.

FOTA updates using nRF Cloud

You can manage FOTA updates through a comprehensive management portal on nRF Cloud, either fully hosted on nRF Cloud or accessible from a customer cloud using the nRF Cloud REST API. If you are using nRF Cloud, see the nRF Cloud Getting Started FOTA documentation for instructions.

Currently, delta modem firmware FOTA files are available in nRF Cloud under Firmware Updates in the Device Management tab on the left. If you intend to obtain FOTA files from nRF Cloud, see the additional requirements in Firmware over-the-air (FOTA) updates.

You can upload custom application binaries to nRF Cloud for application FOTA updates. After Connecting the nRF9160 DK to nRF Cloud, you can upload the files to your nRF Cloud account as a bundle after navigating to Device Management on the left and clicking Firmware Updates.

FOTA updates using other cloud services

FOTA updates can alternatively be hosted from a customer-developed cloud services such as solutions based on AWS and Azure. If you are uploading the files to an Amazon Web Services Simple Storage Service (AWS S3) bucket, see the AWS FOTA documentation for instructions. Samples are provided in nRF Connect SDK for AWS (AWS IoT sample) and Azure (Azure IoT Hub sample).

Your application must be able to retrieve the host and file name for the binary file. See the FOTA download library documentation for information about the format of this information, especially when providing two files for a bootloader upgrade. You can hardcode the information in the application, or you can use a functionality like AWS jobs to provide the URL dynamically.

Samples and applications implementing FOTA

  • Cellular: HTTP full modem update sample - Performs a full firmware OTA update of the modem.

  • Cellular: HTTP modem delta update sample - Performs a delta OTA update of the modem firmware.

  • Cellular: HTTP application update sample - Performs a basic application FOTA update.

  • AWS IoT sample - Performs a FOTA update using MQTT and HTTP, where the firmware download is triggered through an AWS IoT job.

  • Azure IoT Hub sample - Performs a FOTA update from the Azure IoT Hub.

  • Asset Tracker v2 application - Performs FOTA updates of the application, modem (delta), and boot (if enabled). It also supports nRF Cloud FOTA as well as AWS or Azure FOTA. You can configure only one at a time.