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:
Hardware platforms |
PCA |
Board name |
Build target |
|---|---|---|---|
PCA10184 |
nrf54lm20dk/nrf54lm20b/cpuappnrf54lm20dk/nrf54lm20a/cpuapp |
||
PCA10156 |
|
||
PCA10095 |
|
||
PCA10056 |
|
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:
Matter door lock cluster — Remote lock control and credential management over Thread.
Aliro over NFC — Default tap-to-unlock transport. See NFC integration in the reference applications.
Aliro over Bluetooth LE and UWB — Optional hands-free unlock. See Bluetooth LE transport and UWB integration in the reference applications.
Matter Over-The-Air (OTA) update — Remote firmware update through the Matter fabric. See Matter OTA.
Device Firmware Update over SMP — Optional field updates over Bluetooth LE. See Firmware update and DFU SMP service.
Nordic UART Service — Optional Bluetooth LE command channel. See NUS service.
Aliro credential provisioning through Matter — Provision reader credentials from a Matter controller or ecosystem app. See Aliro door lock provisioning with Matter.
Advanced Aliro phases — Optional expedited-fast and step-up authentication. See Advanced Aliro protocol features.
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 |
|---|---|
|
Enables Aliro over Bluetooth LE and UWB.
When disabled, the application uses NFC-only Aliro transport.
By default, the in-tree |
|
Available when |
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).
Configuration |
File name |
FILE_SUFFIX |
Supported board |
Description |
|---|---|---|---|---|
Debug (default) |
|
No suffix |
All from Requirements |
Debug version of the application. Enables additional features for verifying the application behavior, such as logs and shells. |
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_smpsnippet, 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.
Connect the DK to your computer using the DEBUGGER port and set the POWER switch to ON.
In the
project-workspacedirectory, navigate to thencs-door-lock-and-access-controlfolder.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
—
Recommended for new designs.
-DCONFIG_ST25R200_DRV=ySupported, 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
Flash the firmware:
west flashVerify 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) |
|
Aliro over Bluetooth LE and UWB |
|
SMP DFU over Bluetooth LE |
|
Nordic UART Service (NUS) |
|
Combined snippets |
Separate snippet names with semicolons, for example, |
Release build |
|
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.
UART logs are disabled in release builds. Verify LED and button behavior described in User interface, then commission and exercise the device using the steps in Testing.
Dependencies
This application uses the following nRF Door Lock and Access Control Add-on and nRF Connect SDK components:
Matter application layer and OpenThread
Aliro stack (binary library in
lib/aliro)NFC integration in the reference applications — NFC transport and RFAL driver
PSA Crypto
When DFU is enabled, the application also uses MCUboot for image management.
The application depends on the following Zephyr facilities:
Bluetooth host stack (when Bluetooth LE features or UWB transport are enabled)