Configuring Matter in nRF Connect SDK

This page describes what is needed to start working with Matter in the nRF Connect SDK.

Mandatory configuration

To use the Matter protocol, set the following Kconfig options:

  • CONFIG_CHIP - This option enables the Matter protocol stack and other associated Kconfig options, including CONFIG_CHIP_ENABLE_DNSSD_SRP that is required for the discovery of the Matter device using DNS-SD.

  • CONFIG_CHIP_PROJECT_CONFIG - This option defines the path to the configuration file that specifies Vendor ID, Product ID, and other project-specific Matter settings.

Because Matter is an application layer protocol on top of the other IPv6-based transport protocols (see Matter architecture and integration), it uses multiple software modules with their own configuration options to provide the communication between the devices and the necessary functionalities. It uses modules such as Bluetooth® LE, the IPv6 stack (currently, only Thread is supported), nRF Security, or MCUboot. Make sure to review the configuration options of these modules when configuring Matter.

The Kconfig options for Matter applications in the nRF Connect SDK are stored in the following files:

  • prj.conf files, which are specific to the application.

  • Kconfig.defaults file, which is available in the module/lib/matter/config/nrfconnect/chip-module directory and is used to populate prj.conf with Kconfig option settings common to all samples.

The Matter samples use the same structure for other software images, such as MCUboot or Multiprotocol RPMsg, which have default options defined in the corresponding Kconfig.mcuboot.defaults and Kconfig.multiprotocol_rpmsg.defaults files.

For an example configuration, see the Matter Template sample’s prj.conf files in the sample root directory. For instructions about how to set Kconfig options, see Configuring your application.

Optional configuration

After enabling the Matter protocol and defining the path to the Matter configuration file, you can enable additional options in Kconfig.

OpenThread configuration

Enabling CONFIG_CHIP automatically enables the following options related to OpenThread:

Additionally, you can enable the support for Thread Sleepy End Device in Matter by using the CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT Kconfig option. This option sets the CONFIG_OPENTHREAD_MTD_SED Kconfig option. It is enabled by default for some Matter samples: light switch, door lock, and window covering.

For more information about configuring OpenThread in the nRF Connect SDK, see Configuring Thread in the nRF Connect SDK.

Commissioning with NFC

You can configure the Matter protocol to use NFC tag for commissioning, instead of the default QR code.

To enable NFC for commissioning and share the onboarding payload in an NFC tag, set the CONFIG_CHIP_NFC_COMMISSIONING Kconfig option.

Logging configuration

Logging is handled with the CONFIG_LOG option. This option enables logging for both the stack and Zephyr’s Logging API.

Zephyr allows you to configure log levels of different software modules independently. To change the log level configuration for the Matter module, set one of the available options:

Matter shell commands

You can enable the Matter shell library using the CONFIG_CHIP_LIB_SHELL Kconfig option. This option lets you use the Matter shell commands with Matter samples.

See Using CLI in nRF Connect examples in the Matter documentation for the list of available Matter shell commands.

Matter device identification

Matter has many ways to identify a specific device, both mandatory and optional. These can be used for various purposes, such as dividing devices into groups (by function, by vendor or by location), device commissioning or vendor-specific cases before the device was commissioned (for example, identifying factory software version or related features).

Some of these can be configured using the Kconfig options listed below:

  • CONFIG_CHIP_DEVICE_VENDOR_ID sets the device manufacturer identifier that is assigned by the Connectivity Standards Alliance.

  • CONFIG_CHIP_DEVICE_PRODUCT_ID sets the product identifier that is assigned by the product manufacturer.

  • CONFIG_CHIP_DEVICE_TYPE sets the type of the device using the Matter Device Type Identifier, for example Door Lock (0x000A) or Dimmable Light Bulb (0x0101).

  • CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE enables including an optional device type subtype in the commissionable node discovery record. This allows filtering of the discovery results to find the nodes that match the device type.

  • CONFIG_CHIP_ROTATING_DEVICE_ID enables an optional rotating device identifier feature that provides an additional unique identifier for each device. This identifier is similar to the serial number, but it additionally changes at predefined times to protect against long-term tracking of the device.

Amazon FFS support

Matter in the nRF Connect SDK supports Amazon Frustration-Free Setup (FFS) that allows Matter devices to be automatically commissioned to the Matter network using the Matter-enabled Amazon Echo device. To enable the FFS support, set the following configuration options to meet the Amazon FFS setup prerequisites:

Required components for Matter network

The Matter protocol is centered around the Matter network, which requires the following components to operate properly:

  • Matter controller - either CHIP Tool for Linux or macOS, or CHIP Tool for Android

  • Thread Border Router - configured either on PC or Raspberry Pi

For information about how to configure these components, read Configuring Matter controller and Configuring Matter development environment.