zephyr/samples/application_development/sysbuild/with_mcuboot
Gerard Marull-Paretas 93b63df762 samples, tests: convert string-based twister lists to YAML lists
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-10 09:52:37 +02:00
..
src samples, tests, boards: Switch main return type from void to int 2023-04-14 07:49:41 +09:00
sysbuild
CMakeLists.txt
README.rst
prj.conf samples/tests: Add empty prj.conf files 2023-03-17 11:49:27 +01:00
sample.yaml samples, tests: convert string-based twister lists to YAML lists 2023-05-10 09:52:37 +02:00
sysbuild.conf

README.rst

.. _with_mcuboot:

Sample with MCUboot
###################

Overview
********
A simple example that demonstrates how building a sample using sysbuild can
automatically include MCUboot as the bootloader.
It showcases how the sample can adjust the configuration of extra image by
creating a image specific Kconfig fragment.

Sysbuild specific settings
**************************

This sample automatically includes MCUboot as bootloader when built using
sysbuild.

This is achieved with a sysbuild specific Kconfig configuration,
:file:`sysbuild.conf`.

The `SB_CONFIG_BOOTLOADER_MCUBOOT=y` setting in the sysbuild Kconfig file
enables the bootloader when building with sysbuild.

The :file:`sysbuild/mcuboot.conf` file will be used as an extra fragment that
is merged together with the default configuration files used by MCUboot.

:file:`sysbuild/mcuboot.conf` adjusts the log level in MCUboot, as well as
configures MCUboot to prevent downgrades and operate in upgrade-only mode.

To build both the sample and MCUboot with ``west`` for the ``reel_board``, run:

.. zephyr-app-commands::
   :tool: west
   :app: samples/application_development/sysbuild/with_mcuboot
   :board: reel_board
   :goals: build
   :west-args: --sysbuild
   :compact:

Execution output:

.. code-block:: console

   *** Booting Zephyr OS build v3.2.0-rc3-209-gdcf4201d3573  ***
   *** Booting Zephyr OS build v3.2.0-rc3-209-gdcf4201d3573  ***
   Address of sample 0xc000
   Hello sysbuild with mcuboot! nrf52840dk_nrf52840

The first ``Booting Zephyr OS build`` is printed by MCUboot itself and the
following lines are printed by the ``with_mcuboot`` sample.
This sample also prints its flash location.