You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_adding_sysbuild.rst
+6-10Lines changed: 6 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -359,6 +359,8 @@ This variant image will use the same application configuration as the base image
359
359
You only have to modify the version set in the :kconfig:option:`CONFIG_FW_INFO_FIRMWARE_VERSION` Kconfig option.
360
360
To make ``s1_image`` bootable with |NSIB|, the value of :kconfig:option:`CONFIG_FW_INFO_FIRMWARE_VERSION` for the default image (or MCUboot if using MCUboot as a second-stage bootloader) must be bigger than the one for original image.
361
361
362
+
.. _ug_bootloader_using_firmware_loader_mode:
363
+
362
364
Using MCUboot in firmware loader mode
363
365
**************************************
364
366
@@ -430,21 +432,14 @@ The following is an example static Partition Manager file for the nRF53 devices:
430
432
size: 0x2000
431
433
region: sram_primary
432
434
433
-
The project must also have a ``sysbuild.cmake`` file which includes the firmware loader application in the build, this **must** be named ``firmware_loader``:
434
-
435
-
.. code-block:: cmake
436
-
437
-
ExternalZephyrProject_Add(
438
-
APPLICATION firmware_loader
439
-
SOURCE_DIR <path_to_firmware_loader_application>
440
-
)
441
-
442
-
There must also be a ``sysbuild.conf`` file which selects the required sysbuild options for enabling MCUboot and selecting the firmware loader mode:
435
+
The project must also configure MCUboot to operate in firmware loader mode and specify a firmware loader image in the :file:`sysbuild.conf` file.
436
+
For example to select ``smp_svr``, set the following options:
443
437
444
438
.. code-block:: cfg
445
439
446
440
SB_CONFIG_BOOTLOADER_MCUBOOT=y
447
441
SB_CONFIG_MCUBOOT_MODE_FIRMWARE_UPDATER=y
442
+
SB_CONFIG_FIRMWARE_LOADER_IMAGE_SMP_SVR=y
448
443
449
444
At least one mode must be set in MCUboot for entering the firmware loader application, supported entrance methods include:
450
445
@@ -460,3 +455,4 @@ For this example, the use of a GPIO when booting will be used. Create a ``sysbui
460
455
CONFIG_BOOT_FIRMWARE_LOADER_ENTRANCE_GPIO=y
461
456
462
457
The project can now be built and flashed and will boot the firmware loader application when the button is held upon device reboot, or the main application will be booted when the device is reset and the button is not held down.
458
+
See :ref:`sysbuild_images_adding_custom_firmware_loader_images` for details on how to add custom firmware loader images using sysbuild.
The following sysbuild Kconfig options are available when MCUboot is configured in :ref:`firmware loader mode <ug_bootloader_using_firmware_loader_mode>`:
55
+
These options specify the image for the firmware loader:
@@ -63,35 +72,35 @@ Custom images can be added directly to a project (or board) or to a Zephyr modul
63
72
Adding to a single project
64
73
--------------------------
65
74
66
-
To add an image to a single project, you need a ``sysbuild.cmake`` file in the root folder of your project to incorporate the image into the project.
67
-
If the image selection is optional, a ``Kconfig.sysbuild`` file in the root folder of your project is also required to include Kconfig options for the sysbuild configuration.
68
-
If the image selection is mandatory, the ``Kconfig.sysbuild`` file can be omitted.
75
+
To add an image to a single project, you need a :file:`sysbuild.cmake` file in the root folder of your project to incorporate the image into the project.
76
+
If the image selection is optional, a :file:`Kconfig.sysbuild` file in the root folder of your project is also required to include Kconfig options for the sysbuild configuration.
77
+
If the image selection is mandatory, the :file:`Kconfig.sysbuild` file can be omitted.
69
78
70
79
71
-
Kconfig.sysbuild:
80
+
* :file:`kconfig.sysbuild` file:
72
81
73
-
.. code-block:: kconfig
82
+
.. code-block:: kconfig
74
83
75
-
config MY_APP_IMAGE_ABC
76
-
bool "Include ABC image"
77
-
depends on SOC_SERIES_NRF53X
78
-
default y if BOARD_NRF5340DK_NRF5340_CPUAPP
79
-
help
80
-
Will include the ABC image in the build, which will...
84
+
config MY_APP_IMAGE_ABC
85
+
bool "Include ABC image"
86
+
depends on SOC_SERIES_NRF53X
87
+
default y if BOARD_NRF5340DK_NRF5340_CPUAPP
88
+
help
89
+
Will include the ABC image in the build, which will...
81
90
82
-
source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"
91
+
source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"
83
92
84
-
sysbuild.cmake:
93
+
* :file:`sysbuild.cmake` file
85
94
86
-
.. code-block:: cmake
95
+
.. code-block:: cmake
87
96
88
-
if(SB_CONFIG_MY_APP_IMAGE_ABC)
89
-
ExternalZephyrProject_Add(
90
-
APPLICATION ABC
91
-
SOURCE_DIR "<path_to_application>"
92
-
BUILD_ONLY true # This will build the application and not flash it, this **must** be used when building additional images to a core (not the primary image) when using Partition Manager, as the main application for each core will flash a merged hex file instead
93
-
)
94
-
endif()
97
+
if(SB_CONFIG_MY_APP_IMAGE_ABC)
98
+
ExternalZephyrProject_Add(
99
+
APPLICATION ABC
100
+
SOURCE_DIR "<path_to_application>"
101
+
BUILD_ONLY true # This will build the application and not flash it, this **must** be used when building additional images to a core (not the primary image) when using Partition Manager, as the main application for each core will flash a merged hex file instead
102
+
)
103
+
endif()
95
104
96
105
This method can be used to add a new image to the existing board target.
# This will set a bool Kconfig option in the image (note: sysbuild forces this setting, it cannot be overwritten by changing the application configuration)
# This will set a string (or numeric) Kconfig option in the image (note: sysbuild forces this setting, it cannot be overwritten by changing the application configuration)
# This will set a bool Kconfig option in the image (note: sysbuild forces this setting, it cannot be overwritten by changing the application configuration)
# This will set a string (or numeric) Kconfig option in the image (note: sysbuild forces this setting, it cannot be overwritten by changing the application configuration)
# This will set a bool Kconfig option in the image (note: sysbuild forces this setting, it cannot be overwritten by changing the application configuration)
# This will set a string (or numeric) Kconfig option in the image (note: sysbuild forces this setting, it cannot be overwritten by changing the application configuration)
0 commit comments