Perform an OTA Update With Memfault

Perform an OTA firmware upgrade using Memfault

This guide will walk you through flashing devices with initial firmware, setting up the Memfault integration with Blecon, and configuring Memfault to distribute a target firmware for the device to OTA update to.

Pre-requisites

Before starting please make sure you have the following:

Flash your Development Board With Initial Firmware

Follow the Flashing Pre-built Firmware in the guide for your development board to flash the Memfault Example in the pre-built firmware package. The firmware file to flash ends in memfault-1.hex. For instance, on the nRF54L15DK board, use nrf54l15dk-zephyr-x.y.z-memfault-1.hex

Add your Board's Device ID to a Network

You will need the Device ID of your development board to register it into your Blecon Network and also to track its OTA update status in Memfault.

To obtain the Device ID for the Development Board, follow the Connecting to UART section of your Development board. In your terminal program you should see uart:~$ after you press the Enter/Return key.

Once you are connected to the UART, reset the device and wait for the device URL to be printed out in the boot messages.

Hardware version: nrf54l15dk
Software version: 2.1.0+zephyr-memfault-1
Device URL: https://blecon.dev/509a6245-8d3e-4f28-aa6a-b9910814ea9a

You can follow the Device URL to register your device. Alternatively, you can copy and paste the Device ID, which the string of characters following "https://blecon.dev/" into the Register Device section of your Blecon Network.

Add Memfault Integration to a Network

Select the Memfault project that will manage the OTA process. If you do not have a suitable project or if you just signed up to Memfault, create a new project using the MCU > nRF52/53/54 on NCS preset.

Once you have an active project, go to Project Settings in the left sidebar. Copy your project key from the Project Details section.

Go to the Blecon Network that your device is on and click on the Integrations tab. Add the Memfault Integration to your Network. In the configuration pop-up for the integration, paste the project key you copied in the previous step.

Create and Activate an OTA Release

In your Memfault Project, go to the OTA Releases section in the left sidebar. Once in the OTA Releases section, click the Create Release at the top right of the page.

In the configuration pop-up, enter the <version>+zephyr-memfault-2 in the Version textbox, where <version> is the version of your prebuilt firmware.

Once you have created a release, click the Upload OTA Payload to Release button to upload the target firmware to which your device should update. In the Add OTA Payload popup:

  • enter your board type for the Hardware Version

  • enter main for Software Type

  • upload the file ending in memfault-2-app.signed.bin (this is the signed application-only firmware in binary format)

  • Click the Add button

Ensure that the Hardware Version correctly matches the development board you are using

Click the Activate button in the OTA Releases page to activate this release. Select the default cohort, which your board is a part of, and double check that the release version and hardware versions are correct. If everything looks good, click the Activate button.

Triggering an OTA Update and Verifying the new Version

Switch to the Devices page using the left sidebar in Memfault. You should see the Device ID of your development board listed.

Before the OTA Update has been applied, Current Software Version will be <version>+memfault-1 .

You must manually trigger a check for new firmware on you development board by connecting over UART and entering:

uart:~$ blecon memfault_sync

In a production device, you will likely configure your software to perform a check for new versions on device startup and periodically during device operation.

After the OTA Update has been applied, the Current Software Version will become <version>+memfault-2 .

Last updated