Skip to content

Commit c1c4c42

Browse files
kkasperczyk-noLuDuda
authored andcommitted
samples: matter: Added support for mcuboot and DFU with sysbuild
Introduced configuration that allows to enable mcuboot and DFU (over BT SMP) for the Matter samples build with sysbuild. Additionally the support for sysbuild in Matter weather station and Matter bridge was added. Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
1 parent a502619 commit c1c4c42

File tree

69 files changed

+1494
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1494
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#
2+
# Copyright (c) 2023 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
config NRF_DEFAULT_BLUETOOTH
8+
default y if ($(BOARD) = "nrf7002dk_nrf5340_cpuapp")
9+
10+
choice BOOTLOADER
11+
default BOOTLOADER_MCUBOOT
12+
endchoice
13+
14+
if BOOTLOADER_MCUBOOT && ($(BOARD) = "nrf7002dk_nrf5340_cpuapp")
15+
16+
config MCUBOOT_UPDATEABLE_IMAGES
17+
default 2
18+
19+
choice MCUBOOT_MODE
20+
default MCUBOOT_MODE_OVERWRITE_ONLY
21+
endchoice
22+
23+
choice BOOT_SIGNATURE_TYPE
24+
default BOOT_SIGNATURE_TYPE_RSA
25+
endchoice
26+
27+
config SECURE_BOOT
28+
default y
29+
30+
config SECURE_BOOT_NETCORE
31+
default y
32+
33+
config NETCORE_APP_UPDATE
34+
default y
35+
36+
config DFU_MULTI_IMAGE_PACKAGE_BUILD
37+
default y
38+
39+
config DFU_MULTI_IMAGE_PACKAGE_APP
40+
default y
41+
42+
config DFU_MULTI_IMAGE_PACKAGE_NET
43+
default y
44+
45+
endif
46+
47+
source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2023 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
# Set the paritions configuration
8+
set(PM_STATIC_YML_FILE ${ZEPHYR_NRF_MODULE_DIR}/applications/matter_bridge/configuration/${BOARD}/pm_static_dfu.yml PARENT_SCOPE)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# Copyright (c) 2023 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
## Disable serial and UART interface.
8+
CONFIG_SERIAL=n
9+
CONFIG_UART_CONSOLE=n
10+
CONFIG_LOG=n
11+
12+
## RAM usage configuration
13+
CONFIG_HEAP_MEM_POOL_SIZE=8192
14+
CONFIG_MAIN_STACK_SIZE=2048
15+
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
16+
17+
## BT configuration
18+
CONFIG_BT=y
19+
CONFIG_BT_HCI_RAW=y
20+
CONFIG_BT_MAX_CONN=1
21+
CONFIG_BT_CTLR_ASSERT_HANDLER=y
22+
CONFIG_BT_HCI_RAW_RESERVE=1
23+
CONFIG_BT_PERIPHERAL=y
24+
CONFIG_BT_CENTRAL=n
25+
CONFIG_BT_BUF_ACL_RX_SIZE=502
26+
CONFIG_BT_BUF_ACL_TX_SIZE=251
27+
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
28+
CONFIG_BT_CTLR_PHY_2M=n
29+
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since
30+
# Host number of completed commands does not follow normal flow control.
31+
CONFIG_BT_BUF_CMD_TX_COUNT=10
32+
33+
# Debug and assert configuration
34+
CONFIG_ASSERT=y
35+
CONFIG_DEBUG_INFO=y
36+
CONFIG_EXCEPTION_STACK_TRACE=y
37+
CONFIG_RESET_ON_FATAL_ERROR=n
38+
CONFIG_REBOOT=n
39+
40+
# IPC
41+
CONFIG_IPC_SERVICE=y
42+
43+
# Other
44+
CONFIG_MBOX=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#
2+
# Copyright (c) 2023 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
# nRF7002DK uses SPI NOR external flash
8+
CONFIG_GPIO=y
9+
CONFIG_SPI=y
10+
CONFIG_SPI_NOR=y
11+
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
12+
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
13+
14+
CONFIG_MULTITHREADING=y
15+
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
16+
17+
# The following configurations are required to support simultaneous multi image update
18+
CONFIG_PCD_APP=y
19+
CONFIG_UPDATEABLE_IMAGE_NUMBER=2
20+
21+
# Multi-image updates do not support image swapping yet.
22+
CONFIG_BOOT_UPGRADE_ONLY=y
23+
24+
# The network core cannot access external flash directly. The flash simulator must be used to
25+
# provide a memory region that is used to forward the new firmware to the network core.
26+
CONFIG_FLASH_SIMULATOR=y
27+
CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
28+
CONFIG_FLASH_SIMULATOR_STATS=n
29+
30+
# Enable custom command to erase settings partition.
31+
CONFIG_ENABLE_MGMT_PERUSER=y
32+
CONFIG_ZCBOR=y
33+
CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2023 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
chosen {
9+
nordic,pm-ext-flash = &mx25r64;
10+
};
11+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# Copyright (c) 2023 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
CONFIG_MAIN_STACK_SIZE=10240
8+
9+
CONFIG_BOOT_SWAP_SAVE_ENCTLV=n
10+
CONFIG_BOOT_BOOTSTRAP=n
11+
CONFIG_PM=n
12+
13+
CONFIG_FLASH=y
14+
CONFIG_FPROTECT=y
15+
16+
CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h"
17+
18+
# Use minimal C library instead of the Picolib
19+
CONFIG_MINIMAL_LIBC=y
20+
21+
# Bootloader size optimization
22+
CONFIG_CONSOLE=n
23+
CONFIG_SERIAL=n
24+
CONFIG_UART_CONSOLE=n
25+
CONFIG_USE_SEGGER_RTT=n
26+
CONFIG_GPIO=n
27+
28+
CONFIG_BOOT_MAX_IMG_SECTORS=256
29+
30+
CONFIG_LOG=n
31+
CONFIG_CONSOLE_HANDLER=n
32+
CONFIG_BOOT_BANNER=n
33+
CONFIG_TIMESLICING=n
34+
CONFIG_RESET_ON_FATAL_ERROR=n
35+
CONFIG_MULTITHREADING=n
36+
CONFIG_TICKLESS_KERNEL=n
37+
CONFIG_TIMEOUT_64BIT=n
38+
CONFIG_NRF_ENABLE_ICACHE=n
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#
2+
# Copyright (c) 2023 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
config NRF_DEFAULT_MULTIPROTOCOL
8+
default y if ($(BOARD) = "thingy53_nrf5340_cpuapp")
9+
10+
choice BOOTLOADER
11+
default BOOTLOADER_MCUBOOT
12+
endchoice
13+
14+
if BOOTLOADER_MCUBOOT && ($(BOARD) = "thingy53_nrf5340_cpuapp")
15+
16+
config MCUBOOT_UPDATEABLE_IMAGES
17+
default 2
18+
19+
choice MCUBOOT_MODE
20+
default MCUBOOT_MODE_OVERWRITE_ONLY
21+
endchoice
22+
23+
choice BOOT_SIGNATURE_TYPE
24+
default BOOT_SIGNATURE_TYPE_RSA
25+
endchoice
26+
27+
config SECURE_BOOT
28+
default y
29+
30+
config SECURE_BOOT_NETCORE
31+
default y
32+
33+
config NETCORE_APP_UPDATE
34+
default y
35+
36+
config DFU_MULTI_IMAGE_PACKAGE_BUILD
37+
default y
38+
39+
config DFU_MULTI_IMAGE_PACKAGE_APP
40+
default y
41+
42+
config DFU_MULTI_IMAGE_PACKAGE_NET
43+
default y
44+
45+
endif
46+
47+
source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# Copyright (c) 2023 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
if("${OVERLAY_CONFIG}" STREQUAL "overlay-factory_data.conf")
8+
set(PM_STATIC_YML_FILE ${APPLICATION_CONFIG_DIR}/pm_static_factory_data.yml PARENT_SCOPE)
9+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# Copyright (c) 2023 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
## Disable serial and UART interface.
8+
CONFIG_SERIAL=n
9+
CONFIG_UART_CONSOLE=n
10+
CONFIG_LOG=n
11+
12+
## RAM usage configuration
13+
CONFIG_HEAP_MEM_POOL_SIZE=8192
14+
CONFIG_MAIN_STACK_SIZE=2048
15+
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
16+
17+
## BT configuration
18+
CONFIG_BT=y
19+
CONFIG_BT_HCI_RAW=y
20+
CONFIG_BT_MAX_CONN=1
21+
CONFIG_BT_CTLR_ASSERT_HANDLER=y
22+
CONFIG_BT_HCI_RAW_RESERVE=1
23+
CONFIG_BT_PERIPHERAL=y
24+
CONFIG_BT_CENTRAL=n
25+
CONFIG_BT_BUF_ACL_RX_SIZE=502
26+
CONFIG_BT_BUF_ACL_TX_SIZE=251
27+
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
28+
CONFIG_BT_CTLR_PHY_2M=n
29+
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since
30+
# Host number of completed commands does not follow normal flow control.
31+
CONFIG_BT_BUF_CMD_TX_COUNT=10
32+
33+
## 802.15.4 configuration
34+
CONFIG_NRF_802154_SER_RADIO=y
35+
CONFIG_NRF_802154_ENCRYPTION=y
36+
37+
# Debug and assert configuration
38+
CONFIG_ASSERT=y
39+
CONFIG_DEBUG_INFO=y
40+
CONFIG_EXCEPTION_STACK_TRACE=y
41+
CONFIG_RESET_ON_FATAL_ERROR=n
42+
CONFIG_REBOOT=n
43+
44+
# RPMSG backend
45+
CONFIG_IPC_SERVICE_BACKEND_RPMSG=y

samples/matter/light_bulb/Kconfig.sysbuild

+39-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,47 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7-
source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"
8-
97
config NRF_DEFAULT_MULTIPROTOCOL
108
default y if ($(BOARD) = "nrf5340dk_nrf5340_cpuapp")
119

1210
config NRF_DEFAULT_BLUETOOTH
1311
default y if ($(BOARD) = "nrf7002dk_nrf5340_cpuapp")
12+
13+
choice BOOTLOADER
14+
default BOOTLOADER_MCUBOOT
15+
endchoice
16+
17+
if BOOTLOADER_MCUBOOT && (($(BOARD) = "nrf5340dk_nrf5340_cpuapp") || ($(BOARD) = "nrf7002dk_nrf5340_cpuapp"))
18+
19+
config MCUBOOT_UPDATEABLE_IMAGES
20+
default 2
21+
22+
choice MCUBOOT_MODE
23+
default MCUBOOT_MODE_OVERWRITE_ONLY
24+
endchoice
25+
26+
choice BOOT_SIGNATURE_TYPE
27+
default BOOT_SIGNATURE_TYPE_RSA
28+
endchoice
29+
30+
config SECURE_BOOT
31+
default y
32+
33+
config SECURE_BOOT_NETCORE
34+
default y
35+
36+
config NETCORE_APP_UPDATE
37+
default y
38+
39+
config DFU_MULTI_IMAGE_PACKAGE_BUILD
40+
default y
41+
42+
config DFU_MULTI_IMAGE_PACKAGE_APP
43+
default y
44+
45+
config DFU_MULTI_IMAGE_PACKAGE_NET
46+
default y
47+
48+
endif
49+
50+
source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# Copyright (c) 2023 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
if(CONF_FILE)
8+
get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME)
9+
endif()
10+
11+
# Set the paritions configuration
12+
if(NOT "${CONFIG_FILE_NAME}" STREQUAL "prj_no_dfu.conf")
13+
set(PM_STATIC_YML_FILE ${ZEPHYR_NRF_MODULE_DIR}/samples/matter/light_bulb/configuration/${BOARD}/pm_static_dfu.yml PARENT_SCOPE)
14+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# Copyright (c) 2023 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
CONFIG_NORDIC_QSPI_NOR=y
8+
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
9+
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright (c) 2023 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
chosen {
9+
nordic,pm-ext-flash = &mx25r64;
10+
};
11+
};

0 commit comments

Comments
 (0)