Firmware update

The Aliro Access Control Application supports field firmware update over Bluetooth LE Simple Management Protocol (SMP) (DFU over Bluetooth LE SMP).

When built with QM35 Ultra-Wideband (UWB) support, the update image can also bundle QM35825 module firmware (QM35825 firmware upgrade). In the standalone application, SMP DFU is the only way to upload that QM35 image to the device in the field. The application stores it in external flash and applies it to the module during initialization.

For build variants and flashing instructions, see Application guide.

DFU over Bluetooth LE SMP

The Aliro Access Control Application supports field firmware updates over Bluetooth LE using the SMP protocol.

See Device Firmware Update over SMP for transport details and DFU SMP service for the reusable SMP DFU service.

Prerequisites

Before starting the DFU update process, ensure that:

  • The application is built with the dfu_smp snippet.

  • You have built the new application with a higher version number than the one currently running on the device. Set the version in the application VERSION file before building.

  • You have the firmware update image from the build directory (see Output build files in the nRF Connect SDK documentation).

Enabling Bluetooth LE SMP advertising

SMP advertising is not started automatically after boot. Press Button 1 to toggle it.

Alternatively, you can use the shell commands:

uart:~$ dfu_smp on
uart:~$ dfu_smp off

Updating firmware

Set the application version in the applications/aliro-access-control-app/VERSION file before building the update image.

Upload the new firmware image to the device using one of the following methods:

Use nRF Connect Device Manager on a smartphone or tablet.

  1. Build the update image and locate build/dfu_application.zip in the build directory.

  2. Enable SMP advertising on the device (see above).

  3. Open nRF Connect Device Manager, scan for the device, and connect.

  4. Start the firmware update and select dfu_application.zip.

  5. Wait for the upload to finish; the device reboots with the new image.

For a step-by-step walkthrough, see the Nordic Developer Academy course DFU over Bluetooth LE using device manager app.

QM35825 firmware upgrade

The application can update QM35825 UWB module firmware in addition to the main application image. The QM35 image is stored in external flash as an extra MCUboot image and is applied automatically during application initialization when a newer or different version is detected.

Initial QM35 module programming

Before first use of UWB on QM35 hardware, the module coprocessor must run firmware compatible with the host driver in your build.

You can program the module in either of the following ways:

Bundled with the application image

Build with the uwb_qm35_dfu snippet together with uwb_qm35, then flash the full image set with west flash --erase. See Enabling QM35 firmware update below.

Qorvo flash_app on nRF5340 DK

To program the module directly before building the door lock application, use the Qorvo flash_app tool in the qm35-aliro-sdk repository (see Aliro QM35 SDK repository):

  1. Connect the QM35825 module to the nRF5340 DK.

  2. Navigate to qm35-aliro-sdk/flash_app and build:

    west build -b nrf5340dk/nrf5340/cpuapp -p
    
  3. Flash the programmer firmware:

    west flash
    
  4. Confirm on the serial console that flashing completed successfully and the reported firmware version matches your target.

In-field QM35 update

In the standalone application, SMP DFU is the only way to upload the QM35 firmware image to the device in the field. Before you start, ensure that:

  • The application is built with the uwb_qm35_dfu sysbuild snippet (which enables the uwb_qm35_dfu_app application snippet).

  • The application is built with the dfu_smp snippet.

  • A QM35 firmware image is included in the build.

  • The QM35 module is connected and initialized.

Update flow

At startup the application:

  1. Compares the running QM35 firmware version with the version stored in external flash.

  2. Starts an update when the configured version policy matches (higher or different).

  3. Resets the QM35 into firmware update mode and transfers the firmware from external flash to the module.

  4. Resets the QM35 and re-initializes the UWB stack.

  5. Verifies the installation after transfer completes.

Note

During the update, the QM35 is temporarily unavailable.

Enabling QM35 firmware update

Build with the uwb_qm35_dfu snippet together with uwb_qm35. To update both the main application and QM35 over SMP, also include the dfu_smp snippet.

west build -p -b <build_target> applications/aliro-access-control-app -- \
  -DSNIPPET=uwb_qm35_dfu -Daliro-access-control-app_SNIPPET='uwb_qm35;dfu_smp'

The QM35 firmware image is managed automatically during application initialization. Flash the full image set with west flash --erase (see Application guide).

QM35 DFU configuration options

Control QM35 firmware update behavior using the following Kconfig options:

Configuration option

Description

CONFIG_DOOR_LOCK_ALIRO_UWB_QM35_DFU

Enables QM35 firmware upgrade support.

CONFIG_DOOR_LOCK_ALIRO_UWB_QM35_DFU_VERSION_COMPARISON_HIGHER

Updates only if the new version is higher. This is the default behavior.

CONFIG_DOOR_LOCK_ALIRO_UWB_QM35_DFU_VERSION_COMPARISON_DIFFERENT

Updates if the version differs.

Note

Use the CONFIG_DOOR_LOCK_ALIRO_UWB_QM35_DFU_VERSION_COMPARISON_DIFFERENT option if you need to update from an older Qorvo firmware that reports a higher version number than the new firmware. For example, when downgrading from 13.0.1rc2_10977260000 to 0.6.0rc1_12208268663, the default CONFIG_DOOR_LOCK_ALIRO_UWB_QM35_DFU_VERSION_COMPARISON_HIGHER option would block the update, since the target version is lower.

By default, the firmware binary is taken from ${ZEPHYR_QM35_ALIRO_SDK_MODULE_DIR}/firmware/qm35825.bin. To use a different binary, specify its absolute path with the QM35_IMAGE_PATH build argument:

west build -p -b nrf5340dk/nrf5340/cpuapp applications/aliro-access-control-app -- -DQM35_IMAGE_PATH='/path/to/qm35825.bin'

QM35 firmware update monitoring

Monitor QM35 firmware updates through logs:

[00:00:02.123,456] <inf> uwb: QM35 FW version comparison: stored=1.2.3 vs running=1.2.2
[00:00:02.234,567] <inf> uwb: QM35 firmware update started
[00:00:05.345,678] <inf> uwb: QM35 firmware chunk 1/10 transferred
[00:00:10.456,789] <inf> uwb: QM35 firmware update completed successfully
[00:00:11.567,890] <inf> uwb: QM35 FW revision: 1.2.3rc1_[...]

Check the current QM35 firmware version with the shell command:

uart:~$ uwb qm35_fw_version