Skip to content

Commit 8228151

Browse files
samples: matter: Added contact sensor sample
Added new Matter sample - contact sensor. Updated also documentation and .yaml test configurations. Introduced several fixes for the configuration recommended during code review. Signed-off-by: Kamil Kasperczyk <[email protected]>
1 parent 78a2362 commit 8228151

File tree

56 files changed

+11227
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+11227
-4
lines changed
549 Bytes
Loading

doc/nrf/protocols/matter/getting_started/low_power_configuration.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The following Matter samples and applications use the low power configuration by
2020
* :ref:`Matter window covering sample <matter_window_covering_sample>`
2121
* :ref:`Matter weather station application <matter_weather_station_app>`
2222
* :ref:`Matter temperature sensor sample <matter_temperature_sensor_sample>`
23+
* :ref:`Matter contact sensor sample <matter_contact_sensor_sample>`
2324

2425
The following additional materials and tools might help you to optimize, estimate, and measure the power consumption of your device are:
2526

doc/nrf/protocols/matter/getting_started/transmission_power.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ The following table lists the default TX power values.
114114
| +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+
115115
| | nrf54lm20dk | 0 | 0 |
116116
+-------------------------------------------------------------------------+--------------------------+------------------------------------------------------+-----------------------------------------------------------------+
117+
| :ref:`Contact Sensor (SED) <matter_contact_sensor_sample>` | nrf52840dk | 0 | 0 |
118+
| +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+
119+
| | nrf5340dk | 0 | 0 |
120+
| +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+
121+
| | nrf54l15dk | 0 | 0 |
122+
| +--------------------------+------------------------------------------------------+-----------------------------------------------------------------+
123+
| | nrf54lm20dk | 0 | 0 |
124+
+-------------------------------------------------------------------------+--------------------------+------------------------------------------------------+-----------------------------------------------------------------+
117125

118126
.. _ug_matter_gs_transmission_power_thread:
119127

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,11 @@ Keys samples
396396
Matter samples
397397
--------------
398398

399-
* Added the :ref:`matter_temperature_sensor_sample` sample that demonstrates how to implement and test a Matter temperature sensor device.
399+
* Added:
400+
401+
* The :ref:`matter_temperature_sensor_sample` sample that demonstrates how to implement and test a Matter temperature sensor device.
402+
* The :ref:`matter_contact_sensor_sample` sample that demonstrates how to implement and test a Matter contact sensor device.
403+
400404
* Updated all Matter over Wi-Fi samples and applications to store a portion of the application code related to the nRF70 Series Wi-Fi firmware in the external flash memory by default.
401405
This change breaks the DFU between the previous |NCS| versions and the |NCS| v3.2.0.
402406
To fix this, you need to disable storing the Wi-Fi firmware patch in external memory.

doc/nrf/samples/matter.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The following table lists variants and extensions available out of the box for e
2121
- Thermostat
2222
- Smoke CO alarm
2323
- Temperature sensor
24+
- Contact sensor
2425
* - FEM support
2526
- ✔
2627
- ✔
@@ -30,6 +31,7 @@ The following table lists variants and extensions available out of the box for e
3031
-
3132
-
3233
-
34+
-
3335
* - DFU support
3436
- ✔
3537
- ✔
@@ -39,6 +41,7 @@ The following table lists variants and extensions available out of the box for e
3941
- ✔
4042
- ✔
4143
- ✔
44+
- ✔
4245
* - Thread support
4346
- ✔
4447
- ✔
@@ -48,6 +51,7 @@ The following table lists variants and extensions available out of the box for e
4851
- ✔
4952
- ✔
5053
- ✔
54+
- ✔
5155
* - :ref:`Thread role <thread_ot_device_types>`
5256
- Router
5357
- SED
@@ -57,6 +61,7 @@ The following table lists variants and extensions available out of the box for e
5761
- MED
5862
- SED
5963
- SED
64+
- SED
6065
* - :ref:`ICD mode <ug_matter_device_low_power_icd>`
6166
- Not supported
6267
- SIT
@@ -66,6 +71,7 @@ The following table lists variants and extensions available out of the box for e
6671
- Not supported
6772
- LIT
6873
- LIT
74+
- LIT
6975
* - Wi-Fi® support
7076
- ✔
7177
- ✔
@@ -75,6 +81,7 @@ The following table lists variants and extensions available out of the box for e
7581
- ✔
7682
-
7783
-
84+
-
7885
* - Thread and Wi-Fi switching
7986
-
8087
-
@@ -84,6 +91,7 @@ The following table lists variants and extensions available out of the box for e
8491
-
8592
-
8693
-
94+
-
8795
* - Low power configuration by default
8896
-
8997
- ✔
@@ -93,6 +101,7 @@ The following table lists variants and extensions available out of the box for e
93101
-
94102
- ✔
95103
- ✔
104+
- ✔
96105

97106
See the sample documentation pages for instructions about how to enable these variants and extensions.
98107

samples/matter/common/src/zap_samples.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,7 @@
5858
# temperature sensor
5959
- name: temperature_sensor
6060
zap_file: samples/matter/temperature_sensor/src/default_zap/temperature_sensor.zap
61+
62+
# contact sensor
63+
- name: contact_sensor
64+
zap_file: samples/matter/contact_sensor/src/default_zap/contact_sensor.zap
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
cmake_minimum_required(VERSION 3.20.0)
8+
9+
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
10+
11+
project(matter-contact-sensor)
12+
13+
# Enable GNU STD support.
14+
include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/app/enable-gnu-std.cmake)
15+
16+
# NORDIC SDK APP START
17+
18+
# Include all source files that are located in the Matter common directory.
19+
include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/source_common.cmake)
20+
21+
# Include Data Model utils
22+
include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/data_model.cmake)
23+
24+
include(${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common/cmake/zap_helpers.cmake)
25+
ncs_get_zap_parent_dir(ZAP_PARENT_DIR)
26+
27+
target_include_directories(app PRIVATE
28+
src
29+
${ZAP_PARENT_DIR}
30+
)
31+
32+
target_sources(app PRIVATE
33+
src/app_task.cpp
34+
src/main.cpp
35+
)
36+
37+
ncs_configure_data_model()
38+
# NORDIC SDK APP END
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
mainmenu "Matter nRF Connect Contact Sensor Example Application"
7+
8+
choice OPENTHREAD_NORDIC_LIBRARY_CONFIGURATION
9+
default OPENTHREAD_NORDIC_LIBRARY_MTD
10+
endchoice
11+
12+
choice OPENTHREAD_DEVICE_TYPE
13+
default OPENTHREAD_MTD
14+
endchoice
15+
16+
config CHIP_ENABLE_ICD_SUPPORT
17+
default y
18+
19+
config CHIP_ICD_LIT_SUPPORT
20+
default y
21+
22+
config CHIP_ICD_SIT_SLOW_POLL_LIMIT
23+
default 5000
24+
25+
config CHIP_ICD_REPORT_ON_ACTIVE_MODE
26+
default y
27+
28+
# Reduce Thread TX output power to 0 dBm for SED device
29+
config OPENTHREAD_DEFAULT_TX_POWER
30+
default 0
31+
32+
source "$(ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR)/config/nrfconnect/chip-module/Kconfig.features"
33+
source "$(ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR)/config/nrfconnect/chip-module/Kconfig.defaults"
34+
source "$(ZEPHYR_NRF_MODULE_DIR)/samples/matter/common/src/Kconfig"
35+
source "Kconfig.zephyr"
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
#### Radio core selection
8+
config NRF_DEFAULT_IPC_RADIO
9+
default y
10+
11+
# Enable IEEE802.15.4 serialization to network core
12+
# This config automatically pulls in the `overlay-802154.conf` in the ipc_radio image
13+
config NETCORE_IPC_RADIO_IEEE802154
14+
default y if SOC_SERIES_NRF53X
15+
16+
# Enable Bluetooth serialization to network core
17+
# This config automatically pulls in the `overlay-bt_hci_ipc.conf` in the ipc_radio image
18+
config NETCORE_IPC_RADIO_BT_HCI_IPC
19+
default y if SOC_SERIES_NRF53X
20+
21+
#### Bootloader
22+
choice BOOTLOADER
23+
default BOOTLOADER_MCUBOOT
24+
endchoice
25+
26+
if BOOTLOADER_MCUBOOT
27+
28+
#### DFU multi-image support
29+
config DFU_MULTI_IMAGE_PACKAGE_BUILD
30+
default y
31+
32+
config DFU_MULTI_IMAGE_PACKAGE_APP
33+
default y
34+
35+
config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY
36+
default y
37+
38+
#### DFU network core configuration
39+
if SOC_SERIES_NRF53X
40+
41+
config MCUBOOT_UPDATEABLE_IMAGES
42+
default 2
43+
44+
choice MCUBOOT_MODE
45+
default MCUBOOT_MODE_OVERWRITE_ONLY
46+
endchoice
47+
48+
choice BOOT_SIGNATURE_TYPE
49+
default BOOT_SIGNATURE_TYPE_RSA
50+
endchoice
51+
52+
config SECURE_BOOT_NETCORE
53+
default y
54+
55+
config NETCORE_APP_UPDATE
56+
default y
57+
58+
config DFU_MULTI_IMAGE_PACKAGE_NET
59+
default y
60+
61+
endif # SOC_SERIES_NRF53X
62+
63+
if BOARD_NRF54L15DK || BOARD_NRF54LM20DK
64+
65+
# Disable checking the external drivers for nRF54L15 and nRF54LM20 DKs.
66+
config PM_OVERRIDE_EXTERNAL_DRIVER_CHECK
67+
default y
68+
69+
endif # BOARD_NRF54L15DK || BOARD_NRF54LM20DK
70+
71+
endif # BOOTLOADER_MCUBOOT
72+
73+
#### Enable generating factory data
74+
config MATTER_FACTORY_DATA_GENERATE
75+
default y
76+
77+
source "share/sysbuild/Kconfig"

0 commit comments

Comments
 (0)