Skip to content

Commit bdcac62

Browse files
alxelaxanangl
authored andcommitted
samples: bluetooth: mesh: add external flash for dfu target
Commit adds ability to build dfu target sample to use external flash as the secondary partiiotn for dfu procedure. The ability was added only for nrf52840 DK. Signed-off-by: Aleksandr Khromykh <[email protected]>
1 parent f0c481b commit bdcac62

File tree

6 files changed

+76
-0
lines changed

6 files changed

+76
-0
lines changed

samples/bluetooth/mesh/dfu/target/README.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,25 @@ In this sample, UART and SEGGER RTT are available as logging backends.
202202
.. note::
203203
With the :zephyr:board:`nrf52840dongle`, only logging over UART is available.
204204

205+
External flash support
206+
======================
207+
208+
This sample supports external flash memory as secondary storage partition for saving of the incoming firmware images.
209+
See :ref:`ug_bootloader_external_flash` for more information on external flash support as a partition in the :ref:`ug_bootloader_mcuboot_nsib`.
210+
The default configuration does not support external flash memory.
211+
To enable external flash support, set :makevar:`FILE_SUFFIX` to ``ext_flash`` when building the sample.
212+
213+
Build the sample using the following command:
214+
215+
.. code-block:: console
216+
217+
west build -p -b *board_name* -- -DFILE_SUFFIX=ext_flash
218+
219+
.. note::
220+
The external flash is not erased during the internal flash erasing procedure.
221+
See `nRF Util`_ for more information on how to erase the external flash.
222+
Currently, only the external flash on the ``nrf52840dk/nrf52840`` board is supported at the moment.
223+
205224
Dependencies
206225
************
207226

samples/bluetooth/mesh/dfu/target/sample.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,15 @@ tests:
1818
- bluetooth
1919
- ci_build
2020
- sysbuild
21+
sample.bluetooth.mesh_dfu_target.ext_flash:
22+
sysbuild: true
23+
build_only: true
24+
integration_platforms:
25+
- nrf52840dk/nrf52840
26+
platform_allow:
27+
- nrf52840dk/nrf52840
28+
extra_args: FILE_SUFFIX=ext_flash
29+
tags:
30+
- bluetooth
31+
- ci_build
32+
- sysbuild
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
################################################################################
7+
8+
CONFIG_NORDIC_QSPI_NOR=y
9+
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
10+
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
11+
12+
# Maximum number of sectors that image can have
13+
CONFIG_BOOT_MAX_IMG_SECTORS=256
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* Copyright (c) 2025 Nordic Semiconductor ASA
2+
*
3+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
*/
5+
6+
/ {
7+
chosen {
8+
zephyr,code-partition = &boot_partition;
9+
nordic,pm-ext-flash = &mx25r64;
10+
};
11+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* Copyright (c) 2025 Nordic Semiconductor ASA
2+
*
3+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
*/
5+
6+
/ {
7+
chosen {
8+
nordic,pm-ext-flash = &mx25r64;
9+
};
10+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
SB_CONFIG_BOOTLOADER_MCUBOOT=y
8+
SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
9+
SB_CONFIG_DFU_ZIP=y
10+
SB_CONFIG_DFU_ZIP_BLUETOOTH_MESH_METADATA=y
11+
SB_CONFIG_DFU_ZIP_BLUETOOTH_MESH_METADATA_FWID_MCUBOOT_VERSION=y

0 commit comments

Comments
 (0)