You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document the behavior of `CONFIG_ZIGBEE_MATTER_PROTOCOL_STATE_DEFAULT_PROTOCOL`
and `CONFIG_ZIGBEE_MATTER_COEXISTENCE_BUTTON_SWITCH`.
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
In this design, the Zigbee (ZBOSS) and Matter over Thread (OpenThread) stacks run on the same nRF SoC and share the single 802.15.4 radio through a coexistence layer, while a `SoftDevice Controller`_ instance handles Bluetooth LE (CHIPoBLE) commissioning.
93
-
Radio ownership is time-separated and persisted across reboots: the device boots as a Zigbee node, advertises for Matter commissioning over Bluetooth LE in parallel, and hands the 802.15.4 radio over to OpenThread once the first Matter CASE session is established.
93
+
Radio ownership is time-separated and persists across reboots.
94
+
The device boots on the configured default protocol (Zigbee by default).
95
+
While Zigbee is active, Matter advertises for commissioning over Bluetooth LE in parallel.
96
+
The 802.15.4 radio is handed over to OpenThread once Matter commissioning completes or you request a protocol switch.
94
97
95
98
.. list-table::
96
99
:header-rows: 1
@@ -100,8 +103,8 @@ Radio ownership is time-separated and persisted across reboots: the device boots
100
103
- Advantage
101
104
- Trade-off
102
105
* - Deployment model
103
-
- A single firmware image can start as Zigbee and migrate to Matter after commissioning, without reflashing.
104
-
- Switching back to Zigbee requires a Matter factory reset, which clears Matter commissioning data.
106
+
- A single firmware image can start as Zigbee and migrate to Matter after commissioning or a button-triggered switch, without reflashing.
107
+
- Switching back to Zigbee is supported by a long button press. Removing the last Matter fabric or triggering a Matter factory resetclears Matter commissioning data and resets the persisted protocol to the configured default.
105
108
* - Radio usage
106
109
- Bluetooth LE commissioning (CHIPoBLE) runs concurrently with Zigbee operation, so no separate commissioning device is needed.
107
110
- The 802.15.4 radio is used by one stack at a time. Zigbee operation pauses once the device switches to Matter.
As a proof of concept, the Matter extension has the following limitations:
2
2
3
-
* The 802.15.4 radio is time-shared, never concurrent: once the device is provisioned to Matter, Zigbee is torn down, and returning to Zigbee requires a Matter factory reset (which also wipes Matter storage).
4
-
* The Matter extension cannot be combined with the :ref:`Multiprotocol Bluetooth LE extension <zigbee_light_switch_sample_nus>` (``overlay-multiprotocol_ble.conf``) or with the Zigbee-only FOTA build (``FILE_SUFFIX=fota``).
5
-
* The Matter shell (``CONFIG_CHIP_LIB_SHELL``) and the Matter test shell are disabled to avoid option-parsing conflicts with the Zigbee shell.
3
+
* The 802.15.4 radio is time-shared, never concurrent: once the device runs on Matter, Zigbee is torn down until the active protocol changes again.
4
+
To switch back to Zigbee, ensure the ``CONFIG_ZIGBEE_MATTER_COEXISTENCE_BUTTON_SWITCH`` Kconfig option is enabled, then long-press the button.
5
+
Removing all Matter fabrics or triggering a Matter factory reset wipes Matter storage and resets the persisted protocol to the value selected by the ``CONFIG_ZIGBEE_MATTER_PROTOCOL_STATE_DEFAULT_PROTOCOL`` Kconfig option.* The Matter extension cannot be combined with the :ref:`Multiprotocol Bluetooth LE extension <zigbee_light_switch_sample_nus>` (``overlay-multiprotocol_ble.conf``) or with the Zigbee-only FOTA build (``FILE_SUFFIX=fota``).
6
+
* You cannot combine the Matter extension with the :ref:`Multiprotocol Bluetooth LE extension <zigbee_light_switch_sample_nus>` (``overlay-multiprotocol_ble.conf``) or with the Zigbee-only FOTA build (``FILE_SUFFIX=fota``).
6
7
* The memory footprint is tuned empirically for ``nrf54lm20dk/nrf54lm20a/cpuapp`` and ``nrf54lm20dk/nrf54lm20b/cpuapp``; porting to other targets requires revisiting the libc heap, ZBOSS thread, system work queue and partition sizes used by :file:`prj_matter_fota.conf`.
The default protocol on a factory-fresh device is selected by the ``CONFIG_ZIGBEE_MATTER_PROTOCOL_STATE_DEFAULT_PROTOCOL`` Kconfig choice (Zigbee by default).
2
+
A Matter factory reset (including last-fabric removal when ``CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT`` is enabled) applies the same default again and wipes Matter commissioning data.
3
+
After the first run, the persisted protocol state in settings takes precedence until a factory reset or explicit protocol switch changes it.
4
+
5
+
When ``CONFIG_ZIGBEE_MATTER_COEXISTENCE_BUTTON_SWITCH`` is enabled (the default), you can long-press the selected button to switch the active protocol.
6
+
Configure the required hold time by setting the ``CONFIG_ZIGBEE_MATTER_COEXISTENCE_SWITCH_BUTTON_PRESS_TIME_SECONDS`` Kconfig option.
7
+
By default, this option is set to 5 seconds.
8
+
From Zigbee, the coexistence layer stops the ZBOSS stack and hands the 802.15.4 radio to OpenThread for Matter.
9
+
From Matter, the device persists Zigbee as the active protocol and reboots.
10
+
The protocol switch is ignored while the device is joining a Zigbee network or undergoing Matter commissioning.
11
+
12
+
Other Kconfig options in the coexistence layer:
13
+
14
+
* ``CONFIG_ZIGBEE_MATTER_COEXISTENCE_BT_ADV_WHILE_ZIGBEE`` (default enabled) — Matter may advertise for commissioning over Bluetooth LE while Zigbee owns the 802.15.4 radio.
15
+
When disabled, the sample must call ``zigbee_matter_coexistence_signal_matter_board_init()`` after Matter server init, and the Zigbee worker proceeds without waiting for CHIPoBLE advertising.
16
+
* ``CONFIG_ZIGBEE_MATTER_COEXISTENCE_BUTTON_SWITCH`` — Enable or disable the button-triggered protocol switch.
Copy file name to clipboardExpand all lines: samples/light_bulb/README.rst
+18-6Lines changed: 18 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,13 +46,15 @@ It is supported only on the ``nrf54lm20dk/nrf54lm20a/cpuapp`` and ``nrf54lm20dk/
46
46
47
47
The sample-specific behavior is:
48
48
49
-
* On first boot, the device is a standard :ref:`Zigbee Router <zigbee_roles>` exposing the Dimmable Light device, while the Matter stack advertises for commissioning over Bluetooth LE (CHIPoBLE).
49
+
* On first boot, the device starts on the protocol selected by ``CONFIG_ZIGBEE_MATTER_PROTOCOL_STATE_DEFAULT_PROTOCOL`` (Zigbee by default).
50
+
When Zigbee is active, it is a standard :ref:`Zigbee Router <zigbee_roles>` exposing the Dimmable Light device, while the Matter stack advertises for commissioning over Bluetooth LE (CHIPoBLE).
50
51
* After successful Matter commissioning, the device is converted to a Matter Dimmable Light endpoint that serves the On/Off and Level Control clusters and drives the same LED through PWM.
51
52
It can then be controlled by any device on the Matter fabric bound to it (for example, the :ref:`zigbee_light_switch_sample` built with the :ref:`zigbee_light_switch_sample_matter`).
52
-
* On subsequent boots, the device starts directly as a Matter Dimmable Light.
53
-
A Matter factory reset reverts it to a fresh Zigbee Router.
53
+
* On subsequent boots, the device resumes the persisted protocol.
54
+
When Matter was selected, it starts directly as a Matter Dimmable Light.
55
+
A Matter factory reset resets the persisted protocol to the configured default and wipes Matter commissioning data.
54
56
55
-
The radio hand-over, persistent protocol state, factory-reset behavior and onboarding-data generation are common to both combined samples and are described in detail in the :ref:`zigbee_light_switch_sample_matter` section of the Light switch sample.
57
+
The radio hand-over, persistent protocol state, user-triggered protocol switch, factory-reset behavior and onboarding-data generation are common to both combined samples and are described in detail in the :ref:`zigbee_light_switch_sample_matter` section of the Light switch sample.
56
58
57
59
.. _zigbee_light_bulb_sample_touchlink:
58
60
@@ -115,6 +117,9 @@ User interface
115
117
LED 2:
116
118
Turns on when the light bulb joins the network.
117
119
120
+
Button 2:
121
+
If ``CONFIG_ZIGBEE_MATTER_COEXISTENCE_BUTTON_SWITCH`` is enabled (default), it triggers a protocol switch after a long press (``CONFIG_ZIGBEE_MATTER_COEXISTENCE_SWITCH_BUTTON_PRESS_TIME_SECONDS``, 5 s by default).
122
+
118
123
Button 3:
119
124
Depending on how long the button is pressed:
120
125
@@ -241,15 +246,22 @@ Complete the following steps to exercise the full Zigbee-to-Matter flow:
241
246
The two devices form a distributed-security Zigbee network without a Zigbee Coordinator, and the light switch finds and controls the light bulb.
242
247
243
248
While the device is still a Zigbee Router, it also advertises for Matter commissioning over Bluetooth LE.
249
+
#. Optionally, long-press Button 2 for ``CONFIG_ZIGBEE_MATTER_COEXISTENCE_SWITCH_BUTTON_PRESS_TIME_SECONDS`` to switch to Matter.
250
+
The Zigbee stack is stopped and the radio is handed to OpenThread.
251
+
Skip the next step if you use this path and Matter was already commissioned in a previous session.
244
252
#. Commission the device using the onboarding payload produced by the Matter factory data build (QR code or manual pairing code).
245
253
After the Matter CASE session is established, the light bulb hands the radio over to Thread and stops participating in the Zigbee network.
246
254
#. Drive the light bulb from a Matter peer:
247
255
248
256
* From the controller directly, with ``chip-tool onoff toggle …`` or ``chip-tool levelcontrol move-to-level …``.
249
257
* Or by binding a Matter switch to the light bulb and using the switch's dimmer button.
250
258
251
-
#. To return the device to Zigbee operation, trigger a Matter factory reset from the controller (for example, ``chip-tool pairing unpair …``).
252
-
The device reboots as a fresh Zigbee Router with Matter Bluetooth LE advertising active again.
259
+
#. To return the device to Zigbee operation, use one of the following:
260
+
261
+
* Long-press Button 2 for ``CONFIG_ZIGBEE_MATTER_COEXISTENCE_SWITCH_BUTTON_PRESS_TIME_SECONDS``.
262
+
The device reboots and resumes as a Zigbee Router.
263
+
* Or trigger a Matter factory reset from the controller (for example, ``chip-tool pairing unpair …``).
264
+
The device reboots as a fresh Zigbee Router with Matter Bluetooth LE advertising active again, and Matter storage is cleared.
Copy file name to clipboardExpand all lines: samples/light_switch/README.rst
+26-6Lines changed: 26 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,12 +102,15 @@ It is supported only on the ``nrf54lm20dk/nrf54lm20a/cpuapp`` and ``nrf54lm20dk/
102
102
103
103
Protocol selection is time-separated and persisted across reboots:
104
104
105
-
* On first boot, Zigbee owns the 802.15.4 radio and the device behaves as a standard :ref:`Zigbee End Device <zigbee_roles>` (Dimmer Switch).
105
+
* On first boot, the device starts on the protocol selected by ``CONFIG_ZIGBEE_MATTER_PROTOCOL_STATE_DEFAULT_PROTOCOL`` (Zigbee by default) and behaves as a standard :ref:`Zigbee End Device <zigbee_roles>` (Dimmer Switch) when Zigbee is active.
106
106
In parallel, the Matter stack advertises for commissioning over Bluetooth LE (CHIPoBLE) for the duration configured by ``CONFIG_CHIP_BLE_ADVERTISING_DURATION`` (60 s by default).
107
107
* When a Matter commissioner completes commissioning (first CASE session established while Thread is not yet attached), the coexistence layer stops the Zigbee stack, hands the radio over to OpenThread, and persists the selected protocol.
108
108
From this point on, the device operates as a Matter Dimmer Switch that controls remote Matter lights through the client-side binding cluster.
109
-
* On subsequent boots, if the persisted protocol is Matter, the Zigbee stack is skipped entirely and the radio goes directly to OpenThread.
110
-
* A Matter factory reset wipes the Zigbee network information, resets the persisted protocol back to Zigbee, and reboots the device as a fresh, commissioning-ready Zigbee End Device.
109
+
* On subsequent boots, the device resumes the persisted protocol.
110
+
If Matter was selected, the Zigbee stack is skipped entirely and the radio goes directly to OpenThread.
111
+
* A Matter factory reset wipes the Zigbee network information when Zigbee was active, resets the persisted protocol to the value selected by ``CONFIG_ZIGBEE_MATTER_PROTOCOL_STATE_DEFAULT_PROTOCOL``, wipes Matter commissioning data, and reboots the device in that default state.
When you are building the sample with the Matter extension and press the button during normal operation (after boot), it starts Touchlink commissioning as initiator.
346
349
See :ref:`zigbee_light_switch_sample_touchlink`.
347
350
351
+
Matter extension protocol switch assignments
352
+
============================================
353
+
354
+
.. tabs::
355
+
356
+
.. group-tab:: nRF54 DKs
357
+
358
+
Button 2:
359
+
If ``CONFIG_ZIGBEE_MATTER_COEXISTENCE_BUTTON_SWITCH`` is enabled (default), it triggers a protocol switch after a long press (``CONFIG_ZIGBEE_MATTER_COEXISTENCE_SWITCH_BUTTON_PRESS_TIME_SECONDS``, 5 s by default).
360
+
348
361
Multiprotocol Bluetooth LE extension assignments
349
362
================================================
350
363
@@ -531,12 +544,19 @@ Complete the following steps to exercise the full Zigbee-to-Matter flow:
531
544
#. Power the light switch and press the Touchlink button (see :ref:`zigbee_light_switch_sample_touchlink`).
532
545
The two devices form a distributed-security Zigbee network and the light switch finds the bulb to control, without a Zigbee Coordinator on the network.
533
546
534
-
While the device is still a Zigbee End Device, it also advertises for Matter commissioning over Bluetooth LE.
547
+
While the device is still a Zigbee End Device, it also advertises for Matter commissioning over Bluetooth LE if ``CONFIG_ZIGBEE_MATTER_COEXISTENCE_BT_ADV_WHILE_ZIGBEE`` is enabled.
548
+
#. Optionally, long-press Button 2 for ``CONFIG_ZIGBEE_MATTER_COEXISTENCE_SWITCH_BUTTON_PRESS_TIME_SECONDS`` to switch to Matter.
549
+
The Zigbee stack is stopped and the radio is handed to OpenThread.
550
+
Skip the next step if you use this path and Matter was already commissioned in a previous session.
535
551
#. Commission the device using the onboarding payload produced by the Matter factory data build (QR code or manual pairing code).
536
552
After the Matter CASE session is established, the light switch hands the radio over to Thread and stops participating in the Zigbee network.
537
553
#. Bind the light switch to a Matter light (for example, with ``chip-tool binding write binding …``) and use the dimmer button to toggle or dim the bound light over Thread.
538
-
#. To return the device to Zigbee operation, trigger a Matter factory reset from the controller (for example, ``chip-tool pairing unpair …``).
539
-
The device reboots as a fresh Zigbee End Device with Matter Bluetooth LE advertising active again.
554
+
#. To return the device to Zigbee operation, use one of the following:
555
+
556
+
* Long-press Button 2 for ``CONFIG_ZIGBEE_MATTER_COEXISTENCE_SWITCH_BUTTON_PRESS_TIME_SECONDS``.
557
+
The device reboots and resumes as a Zigbee End Device.
558
+
* Or trigger a Matter factory reset from the controller (for example, ``chip-tool pairing unpair …``).
559
+
The device reboots as a fresh Zigbee End Device with Matter Bluetooth LE advertising active again, and Matter storage is cleared.
0 commit comments