From 4d8375c9b176112e0fd413f47d937a71f95640c9 Mon Sep 17 00:00:00 2001 From: Ludvig Jordet Date: Tue, 14 May 2024 14:30:12 +0200 Subject: [PATCH] Bluetooth: Mesh: Add sysbuild support to Light DFU overlay This does the following: * Add sysbuild_dfu.conf to enable the bootloader when building with DFU support. * Replace overlay-dfu.conf with prj_dfu.conf, to enable use of FILE_SUFFIX to specify all required config for the DFU configuration Signed-off-by: Ludvig Jordet --- samples/bluetooth/mesh/light/overlay-dfu.conf | 20 ------ samples/bluetooth/mesh/light/prj_dfu.conf | 72 +++++++++++++++++++ samples/bluetooth/mesh/light/sample.yaml | 2 +- .../bluetooth/mesh/light/sysbuild_dfu.conf | 7 ++ 4 files changed, 80 insertions(+), 21 deletions(-) delete mode 100644 samples/bluetooth/mesh/light/overlay-dfu.conf create mode 100644 samples/bluetooth/mesh/light/prj_dfu.conf create mode 100644 samples/bluetooth/mesh/light/sysbuild_dfu.conf diff --git a/samples/bluetooth/mesh/light/overlay-dfu.conf b/samples/bluetooth/mesh/light/overlay-dfu.conf deleted file mode 100644 index 96e0bad51200..000000000000 --- a/samples/bluetooth/mesh/light/overlay-dfu.conf +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright (c) 2022 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Enable point to point DFU over SMP -CONFIG_BOOTLOADER_MCUBOOT=y -CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y -CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y - -# Enable Extended Advertiser to advertise BT SMP service -CONFIG_BT_EXT_ADV=y -CONFIG_BT_EXT_ADV_MAX_ADV_SET=6 - -# One extra connection for mesh GATT/proxy and one for SMP BT. -CONFIG_BT_MAX_CONN=3 - -# One extra identity for SMP service -CONFIG_BT_ID_MAX=2 diff --git a/samples/bluetooth/mesh/light/prj_dfu.conf b/samples/bluetooth/mesh/light/prj_dfu.conf new file mode 100644 index 000000000000..68d263cb0d79 --- /dev/null +++ b/samples/bluetooth/mesh/light/prj_dfu.conf @@ -0,0 +1,72 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_NCS_SAMPLES_DEFAULTS=y + +# Deffered logging helps improve LPN power consumption +# when friendship is established. +CONFIG_LOG_MODE_DEFERRED=y + +# General configuration +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 +CONFIG_FLASH=y +CONFIG_FLASH_MAP=y +CONFIG_NVS=y +CONFIG_SETTINGS=y +CONFIG_NVS_LOOKUP_CACHE=y +CONFIG_SETTINGS_NVS_NAME_CACHE=y +CONFIG_HWINFO=y +CONFIG_DK_LIBRARY=y +CONFIG_PM_SINGLE_IMAGE=y +CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE=0x8000 +CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE=y + +# Bluetooth configuration +CONFIG_BT=y +CONFIG_BT_DEVICE_NAME="New Mesh Light" +CONFIG_BT_L2CAP_TX_BUF_COUNT=8 + +CONFIG_BT_OBSERVER=y +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_SETTINGS=y +# Increase RX stack size to avoid overflow during provisioning +CONFIG_BT_RX_STACK_SIZE=2700 + +# Disable unused Bluetooth features +CONFIG_BT_CTLR_LE_ENC=n +CONFIG_BT_PHY_UPDATE=n +CONFIG_BT_CTLR_CHAN_SEL_2=n +CONFIG_BT_CTLR_MIN_USED_CHAN=n +CONFIG_BT_CTLR_PRIVACY=n + +# Bluetooth Mesh configuration +CONFIG_BT_MESH=y +CONFIG_BT_MESH_RELAY=y +CONFIG_BT_MESH_FRIEND=y +CONFIG_BT_MESH_TX_SEG_MAX=10 +CONFIG_BT_MESH_PB_GATT=y +CONFIG_BT_MESH_GATT_PROXY=y +CONFIG_BT_MESH_PROXY_USE_DEVICE_NAME=y +CONFIG_BT_MESH_DK_PROV=y + +# Bluetooth Mesh models +CONFIG_BT_MESH_ONOFF_SRV=y + +# ==== DFU specific configuration ==== + +# Enable point to point DFU over SMP +CONFIG_BOOTLOADER_MCUBOOT=y +CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y +CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y + +# Enable Extended Advertiser to advertise BT SMP service +CONFIG_BT_EXT_ADV=y +CONFIG_BT_EXT_ADV_MAX_ADV_SET=6 + +# One extra connection for mesh GATT/proxy and one for SMP BT. +CONFIG_BT_MAX_CONN=3 + +# One extra identity for SMP service +CONFIG_BT_ID_MAX=2 diff --git a/samples/bluetooth/mesh/light/sample.yaml b/samples/bluetooth/mesh/light/sample.yaml index ed84ee4a85f1..392d48ce4e66 100644 --- a/samples/bluetooth/mesh/light/sample.yaml +++ b/samples/bluetooth/mesh/light/sample.yaml @@ -26,5 +26,5 @@ tests: - nrf21540dk/nrf52840 - nrf54l15pdk/nrf54l15/cpuapp platform_allow: nrf52840dk/nrf52840 nrf21540dk/nrf52840 nrf54l15pdk/nrf54l15/cpuapp - extra_args: OVERLAY_CONFIG=overlay-dfu.conf + extra_args: FILE_SUFFIX=dfu tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/mesh/light/sysbuild_dfu.conf b/samples/bluetooth/mesh/light/sysbuild_dfu.conf new file mode 100644 index 000000000000..08a347f06725 --- /dev/null +++ b/samples/bluetooth/mesh/light/sysbuild_dfu.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +SB_CONFIG_BOOTLOADER_MCUBOOT=y