Skip to content

Added support for DFU over Bluetooth LE SMP#112

Open
kkasperczyk-no wants to merge 1 commit into
nrfconnect:mainfrom
kkasperczyk-no:smp_dfu
Open

Added support for DFU over Bluetooth LE SMP#112
kkasperczyk-no wants to merge 1 commit into
nrfconnect:mainfrom
kkasperczyk-no:smp_dfu

Conversation

@kkasperczyk-no
Copy link
Copy Markdown
Contributor

Created a new Kconfig module that provides support for DFU over BLuetooth LE for Zigbee-only solution.

What is still missing and have to be added:

  • Module (mutex) for synchronizing Zigbee FOTA and DFU over BT
  • Documentation
  • Code alignments for light bulb sample

Created a new Kconfig module that provides support for DFU
over BLuetooth LE for Zigbee-only solution.

Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
@kkasperczyk-no kkasperczyk-no requested a review from a team as a code owner June 3, 2026 11:29
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Documentation Preview

The documentation has been built successfully. You can view the preview here: preview

Generated at: 2026-06-03 11:30:43 UTC with commit cf2f23f.

Expand to view changed pages
File Preview
samples/light_switch/README.rst View

Note: The preview will be available after GitHub Pages deployment completes (usually 1-2 minutes). Ensure that generated at timestamp is up to date. If the Pull Request is stale for more than 30 days, the preview may be deleted. In this case, please update the Pull Request, or re-run the Build Documentation workflow to generate a new preview.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Zigbee library module to enable DFU over Bluetooth LE using MCUmgr/SMP for Zigbee-only builds, and wires it into the Light Switch sample (including CI build-only test variants).

Changes:

  • Introduces ZIGBEE_BT_DFU Kconfig + library implementation that enables MCUmgr-over-BLE SMP and starts connectable advertising.
  • Integrates BT DFU initialization into the Light Switch Zigbee app flow, including “confirm image” handling for MCUboot.
  • Updates the Light Switch sample’s Matter-related file split and adds CI build-only configurations for BT DFU variants.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
subsys/lib/zigbee_bt_dfu/zigbee_bt_dfu.c Implements BLE enable + advertising and registers MCUmgr callbacks for SMP DFU flow.
subsys/lib/zigbee_bt_dfu/Kconfig Adds ZIGBEE_BT_DFU feature flag and selects/configures required Bluetooth + MCUmgr options.
subsys/lib/zigbee_bt_dfu/CMakeLists.txt Builds the new library and links MCUboot bootutil.
subsys/lib/Kconfig Exposes the new library Kconfig from the Zigbee libraries menu.
subsys/lib/CMakeLists.txt Builds the new library directory when CONFIG_ZIGBEE_BT_DFU is enabled.
include/zigbee/zigbee_bt_dfu.h Public API header for initializing Zigbee BLE DFU support.
samples/light_switch/src/app_task_zigbee.c Initializes Zigbee BT DFU and reuses MCUboot image confirmation when FOTA/BT DFU is enabled.
samples/light_switch/src/main.cpp Switches Matter-coexistence include to the Matter-specific task header.
samples/light_switch/src/app_task_matter.cpp Aligns include to app_task_matter.h (Matter extension build).
samples/light_switch/include/app_task_matter.h Updates copyright year (no functional change shown in diff).
samples/light_switch/CMakeLists.txt Builds Matter variant with app_task_matter.cpp instead of the prior file.
samples/light_switch/Kconfig Adds a default BT device name when Zigbee BT DFU is enabled.
samples/light_switch/sample.yaml Adds build-only CI test variants for Matter BT DFU and Zigbee FOTA + BT DFU.
samples/light_switch/README.rst Updates source-file structure documentation for the sample split.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +60 to +65
if CONFIG_ZIGBEE_BT_DFU

config BT_DEVICE_NAME
default "Zigbee_Switch"

endif # CONFIG_ZIGBEE_BT_DFU
Comment on lines +17 to +23
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/dfu/mcuboot.h>
#include <zephyr/logging/log.h>
#include <zephyr/mgmt/mcumgr/grp/img_mgmt/img_mgmt.h>
#include <zephyr/mgmt/mcumgr/mgmt/callbacks.h>
#include <zephyr/mgmt/mcumgr/mgmt/mgmt_defines.h>
config ZIGBEE_BT_DFU
bool "Enable DFU over Bluetooth LE SMP feature set"
depends on !CHIP
imply BOOTLOADER_MCUBOOT
Comment on lines +100 to +104
static void advertise(struct k_work *work) {
struct bt_le_adv_param params = BT_LE_ADV_PARAM_INIT(
BT_LE_ADV_OPT_CONN, BT_ADV_INT_MIN, BT_ADV_INT_MAX, NULL);
params.id = 0;

#include <zephyr/sys/reboot.h>
#endif /* CONFIG_ZIGBEE_FOTA */

#if IS_ENABLED(CONFIG_ZIGBEE_FOTA) || IS_ENABLED(CONFIG_ZIGBEE_BT_DFU)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT, AFAIR we've not used IS_ENABLED anywhere.

Suggested change
#if IS_ENABLED(CONFIG_ZIGBEE_FOTA) || IS_ENABLED(CONFIG_ZIGBEE_BT_DFU)
#if defined(CONFIG_ZIGBEE_FOTA) || defined(CONFIG_ZIGBEE_BT_DFU)

#define OTA_ACTIVITY_LED DK_LED2
#endif /* CONFIG_ZIGBEE_FOTA */

#if IS_ENABLED(CONFIG_ZIGBEE_BT_DFU)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if IS_ENABLED(CONFIG_ZIGBEE_BT_DFU)
#ifdef CONFIG_ZIGBEE_BT_DFU

}

#ifdef CONFIG_ZIGBEE_FOTA
#if IS_ENABLED(CONFIG_ZIGBEE_FOTA) || IS_ENABLED(CONFIG_ZIGBEE_BT_DFU)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if IS_ENABLED(CONFIG_ZIGBEE_FOTA) || IS_ENABLED(CONFIG_ZIGBEE_BT_DFU)
#if defined(CONFIG_ZIGBEE_FOTA) || defined(CONFIG_ZIGBEE_BT_DFU)

power_down_unused_ram();
}

#if IS_ENABLED(CONFIG_ZIGBEE_FOTA) || IS_ENABLED(CONFIG_ZIGBEE_BT_DFU)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if IS_ENABLED(CONFIG_ZIGBEE_FOTA) || IS_ENABLED(CONFIG_ZIGBEE_BT_DFU)
#if defined(CONFIG_ZIGBEE_FOTA) || defined(CONFIG_ZIGBEE_BT_DFU)

ZB_ZCL_REGISTER_DEVICE_CB(zcl_device_cb);
#endif /* CONFIG_ZIGBEE_FOTA */

#if IS_ENABLED(CONFIG_ZIGBEE_BT_DFU)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if IS_ENABLED(CONFIG_ZIGBEE_BT_DFU)
#if defined(CONFIG_ZIGBEE_BT_DFU)


if CONFIG_ZIGBEE_BT_DFU

config BT_DEVICE_NAME
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should start using configdefault to not remove dependencies from the original kconfigs, but I will not push you to do it :)

@@ -0,0 +1,88 @@
#
# Copyright (c) 2026 Nordic Semiconductor ASA
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar suggestion for configdefaults as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants