Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/includes/matter_extension_activation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ To produce a size-optimized release build (no logging, console or shell), add :f

Use ``nrf54lm20dk/nrf54lm20b/cpuapp`` as the board target for the nRF54LM20B SoC variant.

.. include:: /includes/matter_extension_bt_dfu.txt

See |sample matter limitations ref| for supported board targets and incompatible options.
15 changes: 15 additions & 0 deletions docs/includes/matter_extension_bt_dfu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Device firmware upgrade over Bluetooth SMP
------------------------------------------

You can update your device's firmware over the air using two methods, both enabled by default in the Matter extension builds:

* Matter OTA – Updates your device through MCUboot, satisfying the Matter specification's requirement to support at least one over-the-air software update method.

* Device Firmware Upgrade (DFU) over Bluetooth LE – Updates your device using the `Simple Management Protocol`_ (SMP).
To enable this method, select the :file:`prj_matter_fota.conf` configuration by setting the ``FILE_SUFFIX=matter_fota`` option.

Matter OTA and SMP DFU are independent transports.
SMP is not part of the Matter specification.
Use `mcumgr`_ or `nRF Connect Device Manager`_ to perform the update.

For step-by-step instructions on testing the update process, see |sample matter bt dfu testing ref|.
49 changes: 49 additions & 0 deletions docs/includes/matter_extension_bt_dfu_testing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
To test DFU over Bluetooth LE SMP, complete the following steps:

1. Build and flash the sample with the Matter extension (see |sample matter activating variants ref|).
#. Confirm the device is running the Matter stack (see |sample matter testing ref|).
#. Briefly press **Button 0** to start Bluetooth LE advertising for SMP.

The behavior depends on the device's commissioning state:

* If the device is not commissioned to a Matter fabric, this starts both Matter commissioning advertising and the SMP server.
* If the device is already commissioned, this re-enables only the SMP server for firmware transfer.

**LED 0** blinks while Bluetooth LE advertising for SMP is active.
The advertised device name is |bt device name|, set by the ``CONFIG_BT_DEVICE_NAME`` Kconfig option in the :file:`prj_matter_fota.conf` file.

#. Perform the update using one of the following methods:

.. tabs::

.. group-tab:: Smartphone

a. Install `nRF Connect Device Manager`_.
#. Use the :file:`dfu_application.zip` file from the build directory.

For detailed instructions, see `FOTA updates on nRF54L Series devices`_ (nRF54L15 and nRF54LM20 DKs) or `FOTA updates with nRF5340 DK`_ (nRF5340 DK) depending on the device you are using.

.. group-tab:: PC (mcumgr)

Upload the signed images from the build directory:

* On single-core SoCs (for example, nRF54L Series), upload the application image:

.. parsed-literal::
:class: highlight

|matter mcumgr smp upload|

* On dual-core SoCs (for example, nRF5340 DK), upload the application and network core images separately:

.. parsed-literal::
:class: highlight

|matter mcumgr smp upload|

|matter mcumgr net smp upload|

After uploading, list the images, mark each new slot as pending, and reset the device.
For the full procedure, see `Performing Device Firmware Upgrade in the nRF Connect examples`_.

After the update completes, MCUboot applies the new image on the next reboot.
39 changes: 39 additions & 0 deletions docs/includes/zigbee_bt_dfu_activation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Activating optional extensions
------------------------------

To activate the :ref:`lib_zigbee_fota`, use the :file:`prj_fota.conf` configuration file together with the ``zigbee_fota_ext_flash`` snippet.
The snippet provides external-flash partition layouts, sysbuild MCUboot settings, and the matching MCUboot configuration (through ``zigbee_fota_mcuboot_ext_flash``).
For example, when building from the command line, use the following command:

.. parsed-literal::
:class: highlight

west build |sample dir| -b *board_target* -- -DFILE_SUFFIX=fota -DSNIPPET=zigbee_fota_ext_flash

The FOTA variant enables `MCUboot image compression`_.
The generated Zigbee update file contains a compressed MCUboot image, and MCUboot decompresses it while applying the update.
This setting reduces the size of the update image.
However, it requires MCUboot to run in overwrite-only mode, which means the device cannot revert to the previous image after an update is applied.

Alternatively, you can :ref:`configure Zigbee FOTA manually <ug_zigbee_configuring_components_ota>`.

.. note::
The decompression support increases the size of the MCUboot image.
When adapting this FOTA configuration to a custom board or application, make sure that the MCUboot partition is large enough for the generated bootloader image.
The FOTA variant uses devicetree-based partitioning with Partition Manager disabled; see :ref:`zigbee_ug_static_partition` for the partition layout requirements.

Device firmware upgrade over Bluetooth SMP (Zigbee-only builds)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To additionally enable Device Firmware Upgrade (DFU) over Bluetooth LE using the Simple Management Protocol (SMP) in a Zigbee-only build, add ``CONFIG_ZIGBEE_BT_DFU=y`` to the FOTA build command:

.. parsed-literal::
:class: highlight

west build |sample dir| -b *board_target* -- -DFILE_SUFFIX=fota -DSNIPPET=zigbee_fota_ext_flash -DCONFIG_ZIGBEE_BT_DFU=y

This option enables the MCUmgr SMP server over Bluetooth LE alongside :ref:`lib_zigbee_fota`.
It cannot be combined with the |sample matter ref| (``CONFIG_CHIP``).
For Matter extension builds, SMP DFU is provided through ``CONFIG_CHIP_DFU_OVER_BT_SMP`` instead.

See |sample zigbee bt dfu testing ref| for step-by-step testing instructions.
36 changes: 36 additions & 0 deletions docs/includes/zigbee_bt_dfu_testing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
To test DFU over Bluetooth SMP in a Zigbee-only build, complete the following steps:

1. Build and flash the sample with the ``CONFIG_ZIGBEE_BT_DFU=y`` Kconfig option (see |sample activating variants ref|).
#. Wait for the device to boot.

After booting, the device automatically starts Bluetooth LE connectable advertising for the SMP server.
The advertised device name is |zigbee bt device name|, set by ``CONFIG_BT_DEVICE_NAME`` when ``CONFIG_ZIGBEE_BT_DFU`` is enabled.

#. Perform the update using one of the following methods:

.. tabs::

.. group-tab:: Smartphone

a. Install `nRF Connect Device Manager`_.
#. Use the :file:`dfu_application.zip` file from the build directory.

For detailed instructions, see `FOTA updates on nRF54L Series devices`_ (nRF54L15 and nRF54LM20 DKs) or `FOTA updates with nRF5340 DK`_ (nRF5340 DK).

.. group-tab:: PC (mcumgr)

Upload the signed application image from the build directory:

.. parsed-literal::
:class: highlight

|zigbee mcumgr smp upload|

After uploading, list the images, mark the new slot as pending, and reset the device.
For the full procedure (image upload, list, test, and reset), see the `MCUmgr Command-line tool`_ page.

After the update completes, MCUboot applies the new image on the next reboot.

.. note::
Zigbee OTA and SMP DFU are independent transports, and SMP is not part of the Zigbee specification.
You can use either `mcumgr`_ or `nRF Connect Device Manager`_ to perform the update over Bluetooth LE.
7 changes: 7 additions & 0 deletions docs/links.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@
.. _`Release notes for the nRF Connect SDK`: https://docs.nordicsemi.com/bundle/ncs-3.2.0/page/nrf/releases_and_maturity/release_notes.html

.. _`CHIP Tool`: https://docs.nordicsemi.com/bundle/ncs-3.2.0/page/matter/chip_tool_guide.html
.. _`mcumgr`: https://docs.nordicsemi.com/bundle/ncs-3.2.0/page/zephyr/services/device_mgmt/mcumgr.html
.. _`Simple Management Protocol`: https://docs.nordicsemi.com/bundle/ncs-3.2.0/page/zephyr/services/device_mgmt/smp_protocol.html
.. _`nRF Connect Device Manager`: https://www.nordicsemi.com/Products/Development-tools/nrf-connect-device-manager
.. _`FOTA updates on nRF54L Series devices`: https://docs.nordicsemi.com/bundle/ncs-3.2.0/page/nrf/app_dev/device_guides/nrf54l/fota_update.html
.. _`FOTA updates with nRF5340 DK`: https://docs.nordicsemi.com/bundle/ncs-3.2.0/page/nrf/app_dev/device_guides/nrf53/fota_update_nrf5340.html
.. _`MCUmgr Command-line tool`: https://docs.nordicsemi.com/bundle/ncs-3.2.0/page/nrf/app_dev/bootloaders_dfu/dfu_tools_mcumgr_cli.html
.. _`Performing Device Firmware Upgrade in the nRF Connect examples`: https://docs.nordicsemi.com/bundle/ncs-3.2.0/page/matter/nrfconnect_examples_software_update.html

.. _`DFU over Zigbee`: https://docs.nordicsemi.com/bundle/nrfutil/page/guides-nrf5sdk/dfu_performing.html#dfu-over-zigbee

Expand Down
7 changes: 7 additions & 0 deletions samples/light_bulb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ endchoice

endif # OPENTHREAD

if ZIGBEE_BT_DFU

config BT_DEVICE_NAME
default "Zigbee_Bulb"

endif # ZIGBEE_BT_DFU

config MPSL_THREAD_COOP_PRIO
default 8

Expand Down
35 changes: 35 additions & 0 deletions samples/light_bulb/Kconfig.sysbuild
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,39 @@ endchoice

endif # MATTER

if BOOTLOADER_MCUBOOT

#### DFU multi-image support
config DFU_MULTI_IMAGE_PACKAGE_BUILD
default y

config DFU_MULTI_IMAGE_PACKAGE_APP
default y

#### DFU dual core configuration
if SOC_SERIES_NRF53

config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY
default y

config MCUBOOT_UPDATEABLE_IMAGES
default 2

choice MCUBOOT_MODE
default MCUBOOT_MODE_OVERWRITE_ONLY
endchoice

config SECURE_BOOT_NETCORE
default y

config NETCORE_APP_UPDATE
default y

config DFU_MULTI_IMAGE_PACKAGE_NET
default y

endif # SOC_SERIES_NRF53

endif # BOOTLOADER_MCUBOOT

source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"
43 changes: 43 additions & 0 deletions samples/light_bulb/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ Configuration

|config|

Source file setup
=================

This sample is split into the following source files:

* The :file:`main` file is the application entry point only.
* The :file:`app_task_zigbee` file manages the application task flow, user input handling, and Zigbee-specific startup and control logic.
It also implements the dimmable light device behavior, including cluster handling and PWM-based brightness control.
* The :file:`app_task_matter` file is used in the Matter extension build only.
It implements the Matter application task flow, button input, and On/Off and Level Control cluster state for the dimmable light endpoint.

..
FEM support
===========
Expand All @@ -93,10 +104,20 @@ Configuration
Configuration files for sample extensions
=========================================

The sample provides predefined configuration files for optional extensions.
You can find the configuration files in the :file:`samples/light_bulb` directory.

.. |sample matter ref| replace:: :ref:`zigbee_light_bulb_sample_matter`
.. |sample matter limitations ref| replace:: :ref:`zigbee_light_bulb_matter_limitations`
.. |sample matter bt dfu testing ref| replace:: :ref:`zigbee_light_bulb_testing_matter_bt_dfu`
.. |sample matter testing ref| replace:: :ref:`zigbee_light_bulb_testing_matter`
.. |sample matter activating variants ref| replace:: :ref:`zigbee_light_bulb_activating_variants`
.. |sample activating variants ref| replace:: :ref:`zigbee_light_bulb_activating_variants`
.. |sample zigbee bt dfu testing ref| replace:: :ref:`zigbee_light_bulb_testing_zigbee_bt_dfu`
.. |sample dir| replace:: samples/light_bulb

.. include:: /includes/zigbee_bt_dfu_activation.txt

.. include:: /includes/matter_extension_activation.txt

User interface
Expand Down Expand Up @@ -263,6 +284,28 @@ Complete the following steps to exercise the full Zigbee-to-Matter flow:
* Or trigger a Matter factory reset from the controller (for example, ``chip-tool pairing unpair …``).
The device reboots as a fresh Zigbee Router with Matter Bluetooth LE advertising active again, and Matter storage is cleared.

.. _zigbee_light_bulb_testing_matter_bt_dfu:

Testing Matter extension DFU over Bluetooth SMP
-----------------------------------------------

.. |bt device name| replace:: MatterZigbeeLb
.. |app name| replace:: light_bulb
.. |matter mcumgr smp upload| replace:: mcumgr --conntype ble --hci 0 --connstring peer_name='MatterZigbeeLb' image upload build/light_bulb/zephyr/zephyr.signed.bin -n 0 -w 1
Comment thread
edmont marked this conversation as resolved.
.. |matter mcumgr net smp upload| replace:: mcumgr --conntype ble --hci 0 --connstring peer_name='MatterZigbeeLb' image upload build/signed_by_mcuboot_and_b0_ipc_radio.bin -n 1 -w 1

.. include:: /includes/matter_extension_bt_dfu_testing.txt

.. _zigbee_light_bulb_testing_zigbee_bt_dfu:

Testing Zigbee FOTA DFU over Bluetooth SMP
------------------------------------------

.. |zigbee bt device name| replace:: Zigbee_Bulb
.. |zigbee mcumgr smp upload| replace:: mcumgr --conntype ble --hci 0 --connstring peer_name='Zigbee_Bulb' image upload build/light_bulb/zephyr/zephyr.signed.bin

.. include:: /includes/zigbee_bt_dfu_testing.txt

Dependencies
************

Expand Down
46 changes: 46 additions & 0 deletions samples/light_bulb/boards/nrf52840dk_nrf52840_fota.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright (c) 2026 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include <nrf52840_partitions.dtsi>
#include <ext_flash/nrf52840dk_partitions.dtsi>

/ {
pwmleds {
pwm_led3: pwm_led_3 {
pwms = <&pwm0 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
};
};

chosen {
ncs,zigbee-timer = &timer2;
};
};

&pwm0 {
pinctrl-0 = <&pwm0_default_alt>;
pinctrl-1 = <&pwm0_sleep_alt>;
pinctrl-names = "default", "sleep";
};

&pinctrl {
pwm0_default_alt: pwm0_default_alt {
group1 {
psels = <NRF_PSEL(PWM_OUT1, 0, 16)>;
nordic,invert;
};
};

pwm0_sleep_alt: pwm0_sleep_alt {
group1 {
psels = <NRF_PSEL(PWM_OUT1, 0, 16)>;
low-power-enable;
};
};
};

&timer2 {
status = "okay";
};
49 changes: 49 additions & 0 deletions samples/light_bulb/boards/nrf5340dk_nrf5340_cpuapp_fota.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright (c) 2026 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include <nrf5340_cpuapp_partitions.dtsi>
#include <ext_flash/nrf5340dk_cpuapp_partitions.dtsi>

/ {
pwmleds {
compatible = "pwm-leds";

pwm_led3: pwm_led_3 {
pwms = <&pwm0 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
};
};

chosen {
ncs,zigbee-timer = &timer2;
};
};

&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default_alt>;
pinctrl-1 = <&pwm0_sleep_alt>;
pinctrl-names = "default", "sleep";
};

&pinctrl {
pwm0_default_alt: pwm0_default_alt {
group1 {
psels = <NRF_PSEL(PWM_OUT1, 0, 31)>;
nordic,invert;
};
};

pwm0_sleep_alt: pwm0_sleep_alt {
group1 {
psels = <NRF_PSEL(PWM_OUT1, 0, 31)>;
low-power-enable;
};
};
};

&timer2 {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright (c) 2026 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include <nrf54l10_cpuapp_partitions.dtsi>
#include <ext_flash/nrf54l10dk_cpuapp_partitions.dtsi>
Loading
Loading