Application guide

This page describes hardware requirements, configuration, building, and verification for the Matter and Aliro Door Lock Application. For firmware update procedures, see Firmware update. For commissioning, provisioning, and feature testing, see Testing. For common issues, see Troubleshooting.

Requirements

The application supports the following development kits:

Supported hardware platforms

Hardware platforms

PCA

Board name

Build target

nRF54LM20 DK

PCA10184

nrf54lm20dk

nrf54lm20dk/nrf54lm20b/cpuapp
nrf54lm20dk/nrf54lm20a/cpuapp

nRF54L15 DK

PCA10156

nrf54l15dk

nrf54l15dk/nrf54l15/cpuapp

nRF5340 DK

PCA10095

nrf5340dk

nrf5340dk/nrf5340/cpuapp

nRF52840 DK

PCA10056

nrf52840dk

nrf52840dk/nrf52840

You also need an NFC reader expansion board connected to the DK. For Aliro over Bluetooth LE and UWB, add an external UWB module on the nRF5340 DK or nRF54LM20 DK.

To commission the device and control it remotely with Matter over Thread, see Aliro door lock provisioning with Matter.

See Hardware requirements for wiring diagrams, VDDIO configuration on nRF54L-series DKs, and the full hardware setup.

Overview

The Matter and Aliro Door Lock Application combines a Matter door lock accessory with an Aliro reader that authenticates User Devices and drives a simulated bolt lock through the Access Manager.

You can exercise the application in the following ways:

  • On a single DK using the serial shell and the development kit buttons and LEDs (see User interface).

  • Through Matter over Thread using CHIP Tool or a commercial ecosystem (see Aliro door lock provisioning with Matter).

  • With the Aliro Test Harness acting as the User Device for NFC or UWB flows (see Testing).

Application features

The Matter and Aliro Door Lock Application supports the following capabilities:

Configuration

The following Kconfig options are useful when customizing prj.conf or build arguments. They are not required for the default NFC-only build.

Configuration option

Description

CONFIG_DOOR_LOCK_BLE_UWB

Enables Aliro over Bluetooth LE and UWB. When disabled, the application uses NFC-only Aliro transport. By default, the in-tree stub_impl is built as the backend for the UWB facade. Provide a functional UWB implementation as described in Integrating a third-party UWB chip to make the Aliro UWB transport operational.

CONFIG_DOOR_LOCK_BLE_UWB_MAX_SESSIONS

Available when CONFIG_DOOR_LOCK_BLE_UWB is enabled. Sets the maximum number of concurrent Aliro Bluetooth LE and UWB sessions. Defaults to CONFIG_BT_MAX_CONN. When changing the session count, set CONFIG_BT_MAX_CONN to at least that value plus any connections used on the default identity by Matter commissioning, SMP DFU, or NUS.

For Bluetooth LE transport and session-limit details, see Bluetooth LE transport.

Debug and release builds

Debug is the default configuration.

In release configuration, the application is built with the following characteristics:

  • All logs are disabled.

  • Power-management options are enabled.

  • Unused peripherals are disabled using the board-specific *_release.overlay.

  • The device resets automatically on a fatal error.

Shell availability differs by build type:

  • In release builds, the UART shell is disabled by default to save memory.

  • In debug builds shell remains enabled for testing and CLI provisioning (see Provisioning with CLI).

Matter Aliro Door Lock Application build configurations

Configuration

File name

FILE_SUFFIX

Supported board

Description

Debug (default)

prj.conf

No suffix

All from Requirements

Debug version of the application.

Enables additional features for verifying the application behavior, such as logs and shells.

Release

prj_release.conf

release

All from Requirements

Release version of the application.

Enables only the necessary application functionality to optimize its performance.

To build in release mode:

west build -p -b <build_target> applications/matter-aliro-door-lock-app -- -DFILE_SUFFIX=release

User interface

The reference application exposes the development kit buttons and LEDs used for Matter commissioning, lock simulation, and optional Bluetooth LE services.

Note

The button and LED numbering differs between development kits. On the nRF52840 and nRF5340 boards, the numbering starts from 1. On the nRF54L15 and nRF54LM20 boards, it starts from 0.

Development kit interface

LED 1:

Shows the overall state of the device and its connectivity. The following states are possible:

  • Short Flash On (50 ms on/950 ms off) - The device is in the unprovisioned (unpaired) state and is waiting for a commissioning application to connect.

  • Rapid Even Flashing (100 ms on/100 ms off) - The device is in the unprovisioned state and a commissioning application is connected over Bluetooth LE.

  • Solid On - The device is fully provisioned to the network.

LED 2:

Shows the state of the lock. The following states are possible:

  • Solid On - The bolt is extended and the door is locked.

  • Off - The bolt is retracted and the door is unlocked.

  • Rapid Even Flashing (50 ms on/50 ms off during 2 s) - The simulated bolt is in motion from one position to another.

Additionally, the LED starts blinking evenly (500 ms on/500 ms off) when the Identify command of the Identify cluster is received on the endpoint 1. The command’s argument can be used to specify the duration of the effect.

Button 1:

Depending on how long you press the button:

  • If pressed for less than three seconds:

    • If the device is not provisioned to the Matter network, it initiates Bluetooth LE advertising for Matter commissioning. Bluetooth LE advertising makes the device discoverable over Bluetooth LE for the predefined period of time (1 hour by default).

  • If pressed for more than three seconds, it initiates the factory reset of the Matter device. Releasing the button within a 3-second window of the initiation cancels the factory reset procedure.

Button 2:

Changes the lock state to the opposite one.

Button 3:

When the application is built with the dfu_smp snippet, toggles Bluetooth LE advertising for DFU over SMP.

SEGGER J-Link USB port:

Used for logs and the UART shell.

NFC reader expansion board:

Connect the selected reader board to the Arduino-compatible headers on the DK (see Near Field Communication reader).

Building and running

This application can be found under ncs-door-lock-and-access-control/applications/matter-aliro-door-lock-app in your folder structure.

To build it, follow the instructions in Building an application for your preferred building environment. See also programming for programming steps and testing for general information about testing and debugging in the nRF Connect SDK.

  1. Connect the DK to your computer using the DEBUGGER port and set the POWER switch to ON.

  2. In the project-workspace directory, navigate to the ncs-door-lock-and-access-control folder.

  3. Build the application for your DK and NFC reader expansion board. Find <build_target> for your DK in the table in Requirements or in Development kit.

    NFC reader expansion board

    Extra CMake argument

    Notes

    X-NUCLEO-NFC12A1

    —

    Recommended for new designs.

    X-NUCLEO-NFC09A1

    -DCONFIG_ST25R200_DRV=y

    Supported, but not recommended for new products.

    Example for the nRF5340 DK with X-NUCLEO-NFC12A1:

    west build -p -b nrf5340dk/nrf5340/cpuapp applications/matter-aliro-door-lock-app
    

    Example for the nRF54L15 DK with X-NUCLEO-NFC09A1:

    west build -p -b nrf54l15dk/nrf54l15/cpuapp applications/matter-aliro-door-lock-app -- -DCONFIG_ST25R200_DRV=y
    
  4. Flash the firmware:

    west flash
    
  5. Verify that the application runs (see Flash and verify).

Build variants

The default quick-start build is Matter with Aliro over NFC only. Use the variants below when you need Bluetooth LE with UWB, optional Bluetooth LE services, or release optimizations.

Replace <build_target> with your DK target from Development kit. For UWB hardware setup, see Ultra-wideband (UWB) module and UWB integration in the reference applications.

Variant

Example build command

Matter and Aliro (NFC only)

west build -p -b <build_target> applications/matter-aliro-door-lock-app

Aliro over Bluetooth LE and UWB

west build -p -b <build_target> applications/matter-aliro-door-lock-app -- -DCONFIG_DOOR_LOCK_BLE_UWB=y Builds the in-tree UWB stub by default. Provide a UWB backend as described in Integrating a third-party UWB chip.

SMP DFU over Bluetooth LE

west build -p -b <build_target> applications/matter-aliro-door-lock-app -- -Dmatter-aliro-door-lock-app_SNIPPET=dfu_smp See Firmware update and DFU SMP service.

Nordic UART Service (NUS)

west build -p -b <build_target> applications/matter-aliro-door-lock-app -- -Dmatter-aliro-door-lock-app_SNIPPET=bt_nus See NUS service.

Combined snippets

Separate snippet names with semicolons, for example, -Dmatter-aliro-door-lock-app_SNIPPET='dfu_smp;bt_nus'.

Release build

west build -p -b <build_target> applications/matter-aliro-door-lock-app -- -DFILE_SUFFIX=release Combine with snippets when needed.

CONFIG_DOOR_LOCK_BLE_UWB enables the Bluetooth LE and Aliro UWB transport. With the default DOOR_LOCK_ALIRO_UWB_IMPL choice it builds the in-tree stub_impl stub, whose methods return -ENOSYS so the application builds and runs without ranging. To get working ranging, plug in a UWB implementation as described in Integrating a third-party UWB chip.

This application supports one Bluetooth LE connection at a time on the default identity. Matter commissioning, SMP DFU, and NUS cannot run concurrently. See Device Firmware Update over SMP for how these services share the Bluetooth LE stack.

Flash and verify

After building, flash the firmware:

west flash

Verify that the application runs correctly:

Connect to the DK with a terminal emulator that supports VT100/ANSI escape characters. The Serial Terminal app is recommended. See Testing and optimization in the nRF Connect SDK documentation for serial settings.

Note

This application has Hardware Flow Control mechanism enabled by default in serial communication. When enabled, it allows devices to manage transmission by informing each other about their current state, ensuring more reliable connection in high-speed communication scenarios.

Press RESET on the DK. You should see the Zephyr boot banner and a line similar to:

Starting nRF Door Lock and Access Control Application

You should also see Matter stack initialization logs similar to:

Init CHIP stack
[DL]OpenThread started: OK
...
[ZCL]Door Lock server initialized

With the default in-tree stub, UWB reports as not implemented and the application continues without ranging.

Dependencies

This application uses the following nRF Door Lock and Access Control Add-on and nRF Connect SDK components:

When DFU is enabled, the application also uses MCUboot for image management.

The application depends on the following Zephyr facilities: