Skip to content

Commit

Permalink
Samples: Bluetooth: Mesh: p2p DFU for nRF53DK
Browse files Browse the repository at this point in the history
Adds point-to-point DFU support for the nRF53DK.
Currently, DFU is only supported for app core image.

Signed-off-by: Anders Storrø <[email protected]>
  • Loading branch information
Andrewpini authored and rlubos committed Jun 5, 2024
1 parent 5bc1b47 commit 0b11ab7
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ Bluetooth Mesh samples that used the :ref:`zephyr:bluetooth-hci-ipc-sample` radi

* Support for the :ref:`nRF54L15 PDK <ug_nrf54l15_gs>` board.
* Support for DFU over Bluetooth Low Energy for the :ref:`nRF54L15 PDK <ug_nrf54l15_gs>` board.
* Support for DFU over Bluetooth Low Energy for the :ref:`nRF5340 DK <ug_nrf5340>` board.

* :ref:`ble_mesh_dfu_target` sample:

Expand Down
8 changes: 3 additions & 5 deletions samples/bluetooth/mesh/light/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ target_include_directories(app PRIVATE
${ZEPHYR_NRF_MODULE_DIR}/samples/bluetooth/mesh/common
)

# Preinitialization related to DFU over SMP for nRF52 series
if(CONFIG_SOC_SERIES_NRF52X)
target_sources_ifdef(CONFIG_MCUMGR_TRANSPORT_BT app PRIVATE
${ZEPHYR_NRF_MODULE_DIR}/samples/bluetooth/mesh/common/smp_bt.c)
endif()
# Preinitialization related to DFU over SMP
target_sources_ifdef(CONFIG_MCUMGR_TRANSPORT_BT app PRIVATE
${ZEPHYR_NRF_MODULE_DIR}/samples/bluetooth/mesh/common/smp_bt.c)

# NORDIC SDK APP END
32 changes: 26 additions & 6 deletions samples/bluetooth/mesh/light/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,35 @@ This sample is split into the following source files:
DFU configuration
=================

To enable the DFU feature for the supported development kits, set :makevar:`SB_CONF_FILE` to :file:`sysbuild-dfu.conf` and set :makevar:`EXTRA_CONF_FILE` to :file:`overlay-dfu.conf` when building the sample.
For example, when building from the command line, use the following command:
.. tabs::

.. code-block:: console
.. tab:: nRF52840 DK and nRF54L15 PDK

west build -b <BOARD> -p -- -DSB_CONF_FILE="sysbuild-dfu.conf" -DEXTRA_CONF_FILE="overlay-dfu.conf"
To enable the DFU feature for the nRF52840 and nRF54L15 development kits, set :makevar:`SB_CONF_FILE` to :file:`sysbuild-dfu.conf` and :makevar:`EXTRA_CONF_FILE` to :file:`overlay-dfu.conf` when building the sample.
For example, when building from the command line, use the following command:

.. code-block:: console
west build -b <BOARD> -p -- -DSB_CONF_FILE="sysbuild-dfu.conf" -DEXTRA_CONF_FILE="overlay-dfu.conf"
The configuration overlay file :file:`overlay-dfu.conf` and the sysbuild configuration file :file:`sysbuild-dfu.conf` enable the DFU feature.
To review the required configuration alterations, open and inspect the two files.

.. tab:: nRF5340 DK

To enable the DFU feature for the nRF5340 development kit, set :makevar:`SB_CONF_FILE` to :file:`sysbuild-dfu.conf` and :makevar:`EXTRA_CONF_FILE` to :file:`overlay-dfu.conf` when building the sample.
Additionally, you need to set the :makevar:`EXTRA_CONF_FILE` for the ipc_radio network image to :file:`overlay-dfu.conf` as well.
This is an additional network image specific configuration overlay file, which allocates the necessary resources to enable the DFU feature.
For example, when building from the command line, use the following command:

.. code-block:: console
west build -b <BOARD> -p -- -DSB_CONF_FILE="sysbuild-dfu.conf" -DEXTRA_CONF_FILE="overlay-dfu.conf" -Dipc_radio_EXTRA_CONF_FILE="overlay-dfu.conf"
.. note::
Currently, the nRF5340 development kit only supports DFU for the application core.
This implies that all application DFU images must be compatible with the network core image running on the device.

The configuration overlay file :file:`overlay-dfu.conf` and the sysbuild configuration file :file:`sysbuild-dfu.conf` enable the DFU feature.
To review the required configuration alterations, open and inspect the two files.
For more information about using configuration overlay files, see :ref:`zephyr:important-build-vars` in the Zephyr documentation.
For more information about selecting a sysbuild configuration file, see the Sysbuild Kconfig file section on the :ref:`zephyr:sysbuild` page in the Zephyr documentation.

Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/mesh/light/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static void bt_ready(int err)

printk("Mesh initialized\n");

if (IS_ENABLED(CONFIG_SOC_SERIES_NRF52X) && IS_ENABLED(CONFIG_MCUMGR_TRANSPORT_BT)) {
if (IS_ENABLED(CONFIG_MCUMGR_TRANSPORT_BT)) {
err = smp_dfu_init();
if (err) {
printk("Unable to initialize DFU (err %d)\n", err);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# One extra connection for mesh GATT/proxy and one for SMP BT.
CONFIG_BT_MAX_CONN=3
CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=3

# Add one additional adv set for SMP
CONFIG_BT_EXT_ADV_MAX_ADV_SET=6

0 comments on commit 0b11ab7

Please sign in to comment.