Added support for DFU over Bluetooth LE SMP#112
Conversation
Documentation PreviewThe documentation has been built successfully. You can view the preview here: preview Generated at: Expand to view changed pages
|
There was a problem hiding this comment.
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_DFUKconfig + 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.
| #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> |
| 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; | ||
|
|
|
|
||
| if CONFIG_ZIGBEE_BT_DFU | ||
|
|
||
| config BT_DEVICE_NAME |
There was a problem hiding this comment.
Maybe we should start using configdefault to not remove dependencies from the original kconfigs, but I will not push you to do it :)
There was a problem hiding this comment.
To be honest I don't know how it works and we have never tried it anywhere. I would prefer to transit all possible defaults at once to not use two different ways at the same time.
| @@ -0,0 +1,88 @@ | |||
| # | |||
| # Copyright (c) 2026 Nordic Semiconductor ASA | |||
There was a problem hiding this comment.
Similar suggestion for configdefaults as above.
edmont
left a comment
There was a problem hiding this comment.
What about moving the cosmetic changes around file names and so on to a separated commit?
edmont
left a comment
There was a problem hiding this comment.
Please reword commit name to subsys: added support for DFU over Bluetooth LE SMP
Added _matter prefix to related app_task files, similarly as it is in light bulb sample. Aligned readme to describe files structure. Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
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>
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: