Skip to content

Commit 493859e

Browse files
committed
samples: matter: add support for nRF21540
This commit adds support for nRF21540 Front-End Module for Matter. Signed-off-by: Lukasz Duda <[email protected]>
1 parent 68e74a0 commit 493859e

19 files changed

+185
-10
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ Matter
9696
* :ref:`Thngy:53 Weather station <matter_weather_station_app>` application.
9797
* :ref:`Template <matter_template_sample>` sample with a guide about :ref:`ug_matter_creating_accessory`.
9898
* :ref:`ug_matter_tools` page with information about building options for Matter controllers.
99+
* PA/LNA GPIO interface support for RF front-end modules (FEM) in Matter.
99100

100101
Zigbee
101102
------

samples/matter/light_bulb/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ cmake_minimum_required(VERSION 3.13.1)
99
option(BUILD_WITH_DFU "Build target with Device Firmware Upgrade support" OFF)
1010
if(BUILD_WITH_DFU)
1111
list(INSERT OVERLAY_CONFIG 0 ${CMAKE_CURRENT_SOURCE_DIR}/../common/config/overlay-dfu_support.conf)
12-
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static.yml)
12+
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static.yml")
13+
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static.yml)
14+
else()
15+
message(FATAL_ERROR "The ${BOARD} target does not support DFU")
16+
endif()
1317
if(${BOARD} STREQUAL "nrf5340dk_nrf5340_cpuapp")
1418
list(INSERT OVERLAY_CONFIG 0 ${CMAKE_CURRENT_SOURCE_DIR}/../common/config/overlay-dfu_nrf53_extension.conf)
1519
endif()

samples/matter/light_bulb/README.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The sample supports the following development kits:
2323

2424
.. table-from-rows:: /includes/sample_board_rows.txt
2525
:header: heading
26-
:rows: nrf52840dk_nrf52840, nrf5340dk_nrf5340_cpuapp
26+
:rows: nrf52840dk_nrf52840, nrf5340dk_nrf5340_cpuapp, nrf21540dk_nrf52840
2727

2828
For remote testing scenarios, you also need the following:
2929

@@ -78,6 +78,11 @@ Device Firmware Upgrade support
7878
:start-after: matter_door_lock_sample_build_with_dfu_start
7979
:end-before: matter_door_lock_sample_build_with_dfu_end
8080

81+
FEM support
82+
===========
83+
84+
.. include:: /includes/sample_fem_support.txt
85+
8186
User interface
8287
**************
8388

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#
2+
# Copyright (c) 2021 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
# Enable Thread 1.2 features
8+
CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y
9+
CONFIG_OPENTHREAD_DUA=y
10+
CONFIG_OPENTHREAD_MLR=y
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2021 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
/*
9+
* In some default configurations within the nRF Connect SDK,
10+
* e.g. on nRF52840, the chosen zephyr,entropy node is &cryptocell.
11+
* This devicetree overlay ensures that default is overridden wherever it
12+
* is set, as this application uses the RNG node for entropy exclusively.
13+
*/
14+
15+
chosen {
16+
zephyr,entropy = &rng;
17+
};
18+
19+
/*
20+
* By default, PWM module is only configured for led0 (LED1 on the board).
21+
* The lighting-app, however, uses LED2 to show the state of the lighting,
22+
* including its brightness level.
23+
*/
24+
aliases {
25+
pwm-led1 = &pwm_led1;
26+
};
27+
28+
pwmleds {
29+
pwm_led1: pwm_led_1 {
30+
pwms = < &pwm0 0xe >;
31+
};
32+
};
33+
34+
};
35+
36+
&pwm0 {
37+
/delete-property/ ch0-pin;
38+
/delete-property/ ch0-inverted;
39+
ch1-pin = < 0xe >;
40+
ch1-inverted;
41+
};

samples/matter/light_bulb/sample.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ sample:
44
tests:
55
matter.light_bulb:
66
build_only: true
7-
platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp
7+
platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf21540dk_nrf52840
88
integration_platforms:
99
- nrf52840dk_nrf52840
1010
- nrf5340dk_nrf5340_cpuapp
11+
- nrf21540dk_nrf52840
1112
tags: ci_build

samples/matter/light_switch/README.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The sample supports the following development kits:
1919

2020
.. table-from-rows:: /includes/sample_board_rows.txt
2121
:header: heading
22-
:rows: nrf52840dk_nrf52840, nrf5340dk_nrf5340_cpuapp
22+
:rows: nrf52840dk_nrf52840, nrf5340dk_nrf5340_cpuapp, nrf21540dk_nrf52840
2323

2424
For this sample to work, you also need the :ref:`Matter light bulb <matter_light_bulb_sample>` sample programmed to another supported development kit.
2525

@@ -50,6 +50,16 @@ After the test mode is activated and both devices are initialized with the same
5050
During this phase, the light bulb device periodically sends multicast messages with static content.
5151
Once such a message is intercepted by the light switch device, the light switch is made aware of the IP address of the nearby light bulb device and the pairing is done.
5252

53+
Configuration
54+
*************
55+
56+
|config|
57+
58+
FEM support
59+
===========
60+
61+
.. include:: /includes/sample_fem_support.txt
62+
5363
User interface
5464
**************
5565

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#
2+
# Copyright (c) 2021 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
# Enable Thread 1.2 features
8+
CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y
9+
CONFIG_OPENTHREAD_DUA=y
10+
CONFIG_OPENTHREAD_MLR=y
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* Copyright (c) 2021 Nordic Semiconductor ASA
2+
*
3+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
*/
5+
6+
/ {
7+
/*
8+
* In some default configurations within the nRF Connect SDK,
9+
* e.g. on nRF52840, the chosen zephyr,entropy node is &cryptocell.
10+
* This devicetree overlay ensures that default is overridden wherever it
11+
* is set, as this application uses the RNG node for entropy exclusively.
12+
*/
13+
chosen {
14+
zephyr,entropy = &rng;
15+
};
16+
};

samples/matter/light_switch/sample.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ sample:
44
tests:
55
matter.light_switch:
66
build_only: true
7-
platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp
7+
platform_allow: nrf52840dk_nrf52840 nrf5340dk_nrf5340_cpuapp nrf21540dk_nrf52840
88
integration_platforms:
99
- nrf52840dk_nrf52840
1010
- nrf5340dk_nrf5340_cpuapp
11+
- nrf21540dk_nrf52840
1112
tags: ci_build

0 commit comments

Comments
 (0)