Performing FOTA Updates on SOM-NRF9151

Performing FOTA Updates on SOM-NRF9151

1.
Overview

The customized Asset Tracker v2 application supports nRF Cloud FOTA updates for the application firmware, MCUboot bootloader and modem firmware (delta updates only).

This document provides instructions how to complete FOTA updates on SOM-NRF9151 platform.

2.
Device Preparations

  1. Set up the hardware platform with LTE and GNSS antennas as described in Setting Up Emcraft SOM-NRF9151 Hardware Platform.

  2. Install the modem and application firmware onto the hardware platform as described in Installing SOM-NRF9151 Images.

  3. Complete certificate provisioning and verify that the hardware platform connects to nRF Cloud as described in Performing IoT Provisioning and Connecting to nRF Cloud.

3.
Updating SOM-NRF9151 Firmware Using nRF Cloud FOTA

3.1.
Uploading DFU Firmware Bundles to nRF Cloud

  1. Download the latest release images for the Asset Tracker v2 application provided in recent Release Notes and extract the downdloaded archive.

  2. Login to the nRF Cloud and go to the DEVICE MANAGEMENT / Firmware Updates page.

  3. Click the Add Bundle button.

  4. In the pop-up window, click Drag and drop your update file(s) or click to select and select one of the DFU firmware bundles:

    • asset_tracker_v2_on_nrf9151som_v*_debug_dfu_application.zip - Debug version of the Asset Tracker v2 DFU image.

    • asset_tracker_v2_on_nrf9151som_v*_release_dfu_application.zip - Release version of the Asset Tracker v2 DFU image.

    • asset_tracker_v2_on_nrf9151som_v*_debug_dfu_mcuboot.zip - Debug version of the bootloader DFU image.

    • asset_tracker_v2_on_nrf9151som_v*_release_dfu_mcuboot.zip - Release version of the bootloader DFU image.

  5. Verify that the correct firmware type is selected (App for the application firmware and MCUboot for the bootloader images):

    image-20250403-212058.png
  6. Select the LTE update type, enter the bundle name and version into the corresponding fields, then click Create/Upload Bundle:

    image-20250403-212243.png
  7. Sort the update bundle list by last modified column to Verify that the firmware bundles with the correct name, type and version have been added:

    image-20250403-212437.png

All necessary update bundles for the nRF91 LTE modem firmware are already uploaded to nRF Cloud.

As an alternative, the DFU images can be uploaded from the build tree:

  • som-nrf9151-app/asset_tracker_v2/build/dfu_application.zip contains a DFU image for the application firmware.

  • som-nrf9151-app/asset_tracker_v2/build/dfu_mcuboot.zip contains a DFU image for the bootloader.

3.2.
Updating the Asset Tracker v2 Application

  1. Login to the nRF Cloud and go to the DEVICE MANAGEMENT / Firmware Updates page.

  2. Click the Create FOTA Update button.

  3. In the pop-up window, enter the update job name, select an appropriate update bundle, device UUIDs or group, then click Create FOTA Update:

    image-20250403-213741.png
  4. Sort the FOTA update job list by last modified column to verify that an item with the correct name, type and version has been added:

    image-20250403-214200.png
  5. Go to the FOTA update job page to review its parameters and status:

    image-20250403-214438.png

The FOTA update job can be also deleted, deployed or restarted from this page.

  1. Reset the target board.

  2. Verify the existing application boots up and connects to nRF Cloud, then note the application version:

    ** Booting nRF Connect SDK v2.8.0-1db0b7d82b2c *** *** Using Zephyr OS v3.7.99-fff5c00d66a8 *** ... [00:00:00.290,252] <inf> main: Start asset_tracker_v2 v98.98-101-release on nrf9151som ... [00:00:12.992,858] <inf> app_event_manager: CLOUD_EVT_CONNECTED ... [00:00:12.994,689] <inf> nrf_cloud_info: Team ID: 8ac47cbc-cc7f-43d0-bb92-de294d73db3e
  3. Wait for the application to complete downloading the update image and reboot the board automatically:

    [00:00:22.424,835] <inf> download_client: Downloading: 30e194e4-5ac2-4e04-a248-867608fd0525/asset_tracker_v2.signed.bin [0] [00:00:22.424,896] <inf> nrf_cloud_fota: Downloading update [00:00:22.424,987] <inf> app_event_manager: CLOUD_EVT_FOTA_START [00:00:24.231,445] <inf> download_client: Setting up TLS credentials, sec tag count 1 [00:00:24.231,597] <inf> download_client: Connecting to 3.164.230.49 [00:00:28.104,156] <inf> download_client: Downloaded 1700/464906 bytes (0%) ... [00:03:18.325,317] <inf> download_client: Downloaded 464906/464906 bytes (100%) [00:03:18.331,634] <inf> download_client: Download complete [00:03:18.584,564] <inf> dfu_target_mcuboot: MCUBoot image-0 upgrade scheduled. Reset device to apply [00:03:18.586,181] <inf> nrf_cloud_fota: Download complete ... [00:03:25.096,130] <err> util_module: Rebooting!
  4. Wait for the MCUboot to swap the old and new images in Flash devices and boot the application:

    uart:~$ ooting nRF Connect SDK v2.8.0-1db0b7d82b2c *** *** Using Zephyr OS v3.7.99-fff5c00d66a8 *** ... *** Booting My Application v2.1.0-dev-792637290154 *** *** Using nRF Connect SDK v2.8.0-1db0b7d82b2c *** *** Using Zephyr OS v3.7.99-fff5c00d66a8 *** I: Starting bootloader I: Primary image: magic=good, swap_type=0x2, copy_done=0x3, image_ok=0x3 I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3 I: Boot source: primary slot I: Starting swap using move algorithm. I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3 I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3 I: Boot source: none I: Bootloader chainload address offset: 0x38000 �: Jumping to the first image slot ... *** Booting nRF Connect SDK v2.8.0-1db0b7d82b2c *** *** Using Zephyr OS v3.7.99-fff5c00d66a8 *** [00:00:00.284,851] <inf> watchdog: Watchdog enabled [00:00:00.287,139] <inf> pmic_irq: PMIC_EVT_START [00:00:00.289,825] <inf> pmic_soc: PMIC_EVT_SOC_NORMAL(99%) [00:00:00.289,886] <inf> pmic_soc: PMIC_EVT_SOC_UPDATE(99%) [00:00:00.291,564] <inf> main: Start asset_tracker_v2 v98.98-103-release-dfu on nrf9151som [00:00:00.291,839] <inf> app_event_manager: APP_EVT_START
  5. Verify that the application firmware version differs from the original one and contains the -dfu suffix:

    [00:00:00.291,564] <inf> main: Start asset_tracker_v2 v98.98-103-release-dfu on nrf9151som
  6. On the FOTA job page, verify that the update status changed to completed:

    image-20250403-220353.png

The DFU and *.hex images from the same release are identical and differ only by the version string.

3.3.
Updating the Bootloader

  1. Login to the nRF Cloud and go to the DEVICE MANAGEMENT / Firmware Updates page.

  2. Click the Create FOTA Update button.

  3. In the pop-up window, enter the update job name, select an appropriate update bundle, device UUIDs or group, then click Create FOTA Update:

    image-20250403-220554.png
  4. Sort the FOTA update job list by last modified column to verify that an item with the correct name, type and version has been added.

  5. Reset the target board.

  6. Verify the existing application boots up and connects to nRF Cloud, then note the MCUboot version:

    ** Booting nRF Connect SDK v2.8.0-1db0b7d82b2c *** *** Using Zephyr OS v3.7.99-fff5c00d66a8 *** Attempting to boot slot 1. Attempting to boot from address 0x20200. I: Verifying signature against key 0. I: Hash: 0x28...b9 I: Firmware signature verified. Firmware version 1 ... [00:00:00.290,252] <inf> main: Start asset_tracker_v2 v98.98-103-release-dfu on nrf9151som ... [00:00:13.540,557] <inf> app_event_manager: CLOUD_EVT_CONNECTED ... [00:00:13.542,419] <inf> nrf_cloud_info: Team ID: 8ac47cbc-cc7f-43d0-bb92-de294d73db3e

The DFU and *.hex images are identical and differ only by the version number (monotonic counter):

The firmware version for the *.hex images is 1.

For the DFU images, the firmware version matches the build number (e.g. for the build 98.98-103, the MCUboot FW version will be 103). This value should be higher that the installed MCUboot version number for the FOTA update to succeed.

The DFU image should be also signed by the same signing key as the existing firmware.

  1. Wait for the application to complete downloading the update image and reboot the board automatically:

    [00:00:22.140,594] <inf> fota_download: B1 update, selected s1 file: e2cdcb18-647f-437b-80de-2f96cfb4117e/signed_by_mcuboot_and_b0_s1_image.bin [00:00:22.140,716] <inf> download_client: Downloading: e2cdcb18-647f-437b-80de-2f96cfb4117e/signed_by_mcuboot_and_b0_s1_image.bin [0] [00:00:22.140,747] <inf> nrf_cloud_fota: Downloading update [00:00:22.140,838] <inf> app_event_manager: CLOUD_EVT_FOTA_START [00:00:22.958,740] <inf> download_client: Setting up TLS credentials, sec tag count 1 [00:00:22.958,862] <inf> download_client: Connecting to 3.164.230.110 [00:00:26.516,693] <inf> download_client: Downloaded 1700/39279 bytes (4%) ... [00:00:41.927,947] <inf> download_client: Download complete [00:00:42.182,250] <inf> dfu_target_mcuboot: MCUBoot image-0 upgrade scheduled. Reset device to apply [00:00:42.183,990] <inf> nrf_cloud_fota: Download complete ... [00:00:49.736,785] <err> util_module: Rebooting!
  2. Wait for the MCUboot to swap the old and new images in Flash devices and boot the application:

    ... uart:~$ ooting nRF Connect SDK v2.8.0-1db0b7d82b2c *** *** Using Zephyr OS v3.7.99-fff5c00d66a8 *** Attempting to boot slot 0. Attempting to boot from address 0x8200. I: Verifying signature against key 0. I: Hash: 0x28...b9 I: Firmware signature verified. Firmware version 1 *** Booting My Application v2.1.0-dev-792637290154 *** *** Using nRF Connect SDK v2.8.0-1db0b7d82b2c *** *** Using Zephyr OS v3.7.99-fff5c00d66a8 *** I: Starting bootloader I: Primary image: magic=good, swap_type=0x2, copy_done=0x1, image_ok=0x1 I: Secondary image: magic=good, swap_type=0x2, copy_done=0x3, image_ok=0x3 I: Boot source: none I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3 I: Secondary image: magic=good, swap_type=0x2, copy_done=0x3, image_ok=0x3 I: Boot source: none I: Image index: 1, Swap type: test I: Starting swap using nsib algorithm. *** Booting nRF Connect SDK v2.8.0-1db0b7d82b2c *** *** Using Zephyr OS v3.7.99-fff5c00d66a8 *** Attempting to boot slot 1. Attempting to boot from address 0x20200. I: Verifying signature against key 0. I: Hash: 0x28...b9 I: Firmware signature verified. Firmware version 103 I: Setting monotonic counter (version: 103, slot: 1) ... [00:00:00.290,252] <inf> main: Start asset_tracker_v2 v98.98-103-release-dfu on nrf9151som ... [00:00:13.540,557] <inf> app_event_manager: CLOUD_EVT_CONNECTED ... [00:00:13.542,419] <inf> nrf_cloud_info: Team ID: 8ac47cbc-cc7f-43d0-bb92-de294d73db3e
  3. Verify that the MCUboot firmware version differs from the original:

    Firmware version 103
  4. On the FOTA job page, verify that the update status changed to completed:

    image-20250403-221619.png

3.4.
Updating the LTE Modem Firmware

  1. Login to the nRF Cloud and go to the DEVICE MANAGEMENT / Firmware Updates page.

  2. Click the Create FOTA Update button.

  3. In the pop-up window, enter the update job name, select an appropriate update bundle, device UUIDs or group, then click Create FOTA Update:

    image-20250403-222259.png
  4. Sort the FOTA update job list by last modified column to verify that an item with the correct name, type and version has been added.

  5. Reset the target board.

  6. Go to the device page and check the modem firmware version on the Device Information card:

    image-20250403-224219.png
  7. Verify the existing application boots up and connects to nRF Cloud, then use the at AT%SHORTSWVER to note the modem firmware version:

    ** Booting nRF Connect SDK v2.8.0-1db0b7d82b2c *** *** Using Zephyr OS v3.7.99-fff5c00d66a8 *** ... [00:00:00.290,252] <inf> main: Start asset_tracker_v2 v98.98-103-release-dfu on nrf9151som ... [00:00:13.540,557] <inf> app_event_manager: CLOUD_EVT_CONNECTED ... [00:00:13.542,419] <inf> nrf_cloud_info: Team ID: 8ac47cbc-cc7f-43d0-bb92-de294d73db3e ... uart:~$ at AT%SHORTSWVER %SHORTSWVER: nrf91x1_2.0.2 OK
  8. Wait for the application to complete downloading the update image and reboot the board automatically:

    [00:00:23.904,663] <inf> download_client: Downloading: 59cec896-c842-40fe-9a95-a4f3e88a4cdb/mfw_nrf91x1_update_from_2.0.2_to_2.0.2-FOTA-TEST.bin [0] [00:00:23.904,724] <inf> nrf_cloud_fota: Downloading update [00:00:23.904,815] <inf> app_event_manager: CLOUD_EVT_FOTA_START [00:00:25.540,893] <inf> download_client: Setting up TLS credentials, sec tag count 1 [00:00:25.541,046] <inf> download_client: Connecting to 3.164.230.110 [00:00:28.596,252] <inf> download_client: Downloaded 1700/14648 bytes (11%) [00:00:28.596,527] <inf> dfu_target_modem_delta: Modem firmware version: 320176d5-9f40-45fc-923b-2661ec18d547 [00:00:28.598,999] <inf> dfu_target_modem_delta: Deleting firmware image, this can take several minutes [00:00:36.814,819] <inf> dfu_target_modem_delta: Modem FW delete complete ... [00:00:44.619,750] <inf> nrf_cloud_fota: A job is already available or in progress... skipping [00:00:44.782,470] <inf> download_client: Downloaded 14648/14648 bytes (100%) [00:00:45.415,039] <inf> download_client: Download complete [00:00:45.733,856] <inf> dfu_target_modem_delta: Scheduling modem firmware upgrade at next boot [00:00:45.735,351] <inf> nrf_cloud_fota: Download complete ... [00:00:52.589,111] <err> util_module: Rebooting!
  9. After the reboot, check that the modem version differs from the original one:

    ** Booting nRF Connect SDK v2.8.0-1db0b7d82b2c *** *** Using Zephyr OS v3.7.99-fff5c00d66a8 *** ... [00:00:00.290,252] <inf> main: Start asset_tracker_v2 v98.98-103-release-dfu on nrf9151som ... uart:~$ at AT%SHORTSWVER %SHORTSWVER: nrf91x1_2.0.2-FOTA-TEST OK
  10. On the FOTA job page, verify that the update status changed to completed:

    image-20250403-223718.png
  11. Go to the device page and verify that the modem firmware version on the Device Information card has changed:

    image-20250403-224019.png

FOTA update will be rejected, if the new modem firmware matches the existing one:

[00:00:54.152,282] <err> dfu_target_modem_delta: Write failed, modem error 9 [00:00:54.152,282] <inf> fota_download: Image refused [00:00:54.157,012] <inf> download_client: Fragment refused, download stopped. [00:00:54.162,933] <err> nrf_cloud_transport: NRF_CLOUD_FOTA_EVT_ERROR

If an update job has been created for a group of devices with different modem firmware versions, the update might be rejected by some of the devices and the update job will be reported as COMPLETED WITH ERRORS. This won’t affect devices with mismatching version from the same device group.