README.rst
1.. _with_mcuboot:
2
3Sample with MCUboot
4###################
5
6Overview
7********
8A simple example that demonstrates how building a sample using sysbuild can
9automatically include MCUboot as the bootloader.
10It showcases how the sample can adjust the configuration of extra image by
11creating a image specific Kconfig fragment.
12
13Sysbuild specific settings
14**************************
15
16This sample automatically includes MCUboot as bootloader when built using
17sysbuild.
18
19This is achieved with a sysbuild specific Kconfig configuration,
20:file:`sysbuild.conf`.
21
22The `SB_CONFIG_BOOTLOADER_MCUBOOT=y` setting in the sysbuild Kconfig file
23enables the bootloader when building with sysbuild.
24
25The :file:`sysbuild/mcuboot.conf` file will be used as an extra fragment that
26is merged together with the default configuration files used by MCUboot.
27
28:file:`sysbuild/mcuboot.conf` adjusts the log level in MCUboot, as well as
29configures MCUboot to prevent downgrades and operate in upgrade-only mode.
30
31To build both the sample and MCUboot with ``west`` for the ``reel_board``, run:
32
33.. zephyr-app-commands::
34 :tool: west
35 :app: samples/application_development/sysbuild/with_mcuboot
36 :board: reel_board
37 :goals: build
38 :west-args: --sysbuild
39 :compact:
40
41Execution output:
42
43.. code-block:: console
44
45 *** Booting Zephyr OS build v3.2.0-rc3-209-gdcf4201d3573 ***
46 *** Booting Zephyr OS build v3.2.0-rc3-209-gdcf4201d3573 ***
47 Address of sample 0xc000
48 Hello sysbuild with mcuboot! nrf52840dk_nrf52840
49
50The first ``Booting Zephyr OS build`` is printed by MCUboot itself and the
51following lines are printed by the ``with_mcuboot`` sample.
52This sample also prints its flash location.
53