-
Notifications
You must be signed in to change notification settings - Fork 23
Added support for DFU over Bluetooth LE SMP #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * Copyright (c) 2026 Nordic Semiconductor ASA | ||
| * | ||
| * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| */ | ||
|
|
||
| /** | ||
| * @file zigbee_bt_dfu.h | ||
| * | ||
| * @brief DFU over Bluetooth LE SMP helpers for Zigbee applications. | ||
| */ | ||
|
|
||
| #ifndef ZIGBEE_BT_DFU_H_ | ||
| #define ZIGBEE_BT_DFU_H_ | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| void zigbee_bt_dfu_init(void); | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* ZIGBEE_BT_DFU_H_ */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
samples/light_switch/src/app_task.h → ...es/light_switch/include/app_task_matter.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
samples/light_switch/src/app_task.cpp → samples/light_switch/src/app_task_matter.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # | ||
| # Copyright (c) 2026 Nordic Semiconductor ASA | ||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
|
|
||
| zephyr_library() | ||
| zephyr_library_sources(zigbee_bt_dfu.c) | ||
|
|
||
| zephyr_library_link_libraries(MCUBOOT_BOOTUTIL) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| # | ||
| # Copyright (c) 2026 Nordic Semiconductor ASA | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar suggestion for |
||
| # | ||
| # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
| # | ||
|
|
||
| config ZIGBEE_BT_DFU | ||
| bool "Enable DFU over Bluetooth LE SMP feature set" | ||
| depends on !CHIP | ||
| select BOOTLOADER_MCUBOOT | ||
| select BT | ||
| select BT_PERIPHERAL | ||
| select MCUMGR | ||
| select MCUMGR_TRANSPORT_BT | ||
| select IMG_MANAGER | ||
| select STREAM_FLASH | ||
| select ZCBOR | ||
| select MCUMGR_GRP_IMG | ||
| select MCUMGR_GRP_OS | ||
| select MCUMGR_GRP_IMG_STATUS_HOOKS | ||
| # Enable custom SMP request to erase settings partition. | ||
| select MCUMGR_GRP_ZBASIC | ||
| select MCUMGR_GRP_ZBASIC_STORAGE_ERASE | ||
| select MCUMGR_TRANSPORT_BT_REASSEMBLY | ||
| help | ||
| Enables Device Firmware Upgrade over Bluetooth LE with SMP and configures | ||
| the set of options related to that feature. | ||
|
|
||
| Cannot be combined with Matter (CONFIG_CHIP), as it requires different Bluetooth LE orchestration. | ||
| Use Matter's CONFIG_CHIP_DFU_OVER_BT_SMP instead. | ||
|
|
||
| if ZIGBEE_BT_DFU | ||
|
|
||
| config BT_MAX_CONN | ||
| default 1 | ||
|
|
||
| # MCU Manager and SMP configuration | ||
| choice MCUMGR_TRANSPORT_BT_PERM | ||
| default MCUMGR_TRANSPORT_BT_PERM_RW | ||
| endchoice | ||
|
|
||
| config MCUMGR_TRANSPORT_NETBUF_COUNT | ||
| default 6 | ||
|
|
||
| config MCUMGR_MGMT_NOTIFICATION_HOOKS | ||
| bool | ||
| default y | ||
|
|
||
| config MCUMGR_GRP_IMG_UPLOAD_CHECK_HOOK | ||
| bool | ||
| default y | ||
|
|
||
| config MCUMGR_SMP_COMMAND_STATUS_HOOKS | ||
| bool | ||
| default y | ||
|
|
||
| # Increase BT MTU and RX buffer sizes to improve DFU throughput | ||
| config BT_L2CAP_TX_MTU | ||
| default 498 | ||
|
|
||
| config BT_BUF_ACL_RX_SIZE | ||
| default 502 | ||
|
|
||
| # Increase MCUMGR_TRANSPORT_NETBUF_SIZE, as it must be big enough to fit MAX MTU + overhead and for single-image DFU default is 384 B | ||
| config MCUMGR_TRANSPORT_NETBUF_SIZE | ||
| default 1024 | ||
|
|
||
| # Increase system workqueue size, as SMP is processed within it | ||
| config SYSTEM_WORKQUEUE_STACK_SIZE | ||
| default 2800 | ||
|
|
||
| if SOC_SERIES_NRF53 | ||
|
|
||
| # Enable custom SMP request to erase settings partition. | ||
| config MCUMGR_GRP_ZBASIC | ||
| default y | ||
|
|
||
| config MCUMGR_GRP_ZBASIC_STORAGE_ERASE | ||
| default y | ||
|
|
||
| endif # SOC_SERIES_NRF53 | ||
|
|
||
| module = ZIGBEE_BT_DFU | ||
| module-str = Zigbee Bluetooth LE DFU | ||
| source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" | ||
|
|
||
| endif # ZIGBEE_BT_DFU | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
configdefaultto not remove dependencies from the original kconfigs, but I will not push you to do it :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.