File tree 9 files changed +95
-1
lines changed
9 files changed +95
-1
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ endfunction()
216
216
# and debugging.
217
217
#
218
218
function (ExternalZephyrProject_Add)
219
- set (app_types MAIN BOOTLOADER)
219
+ set (app_types MAIN BOOTLOADER FIRMWARE_LOADER )
220
220
cmake_parse_arguments (ZBUILD "" "APPLICATION;BOARD;BOARD_REVISION;SOURCE_DIR;APP_TYPE;BUILD_ONLY" "" ${ARGN} )
221
221
222
222
if (ZBUILD_UNPARSED_ARGUMENTS)
Original file line number Diff line number Diff line change @@ -30,6 +30,13 @@ elseif(SB_CONFIG_MCUBOOT_MODE_RAM_LOAD)
30
30
set (bootmode CONFIG_BOOT_RAM_LOAD)
31
31
elseif (SB_CONFIG_MCUBOOT_MODE_FIRMWARE_UPDATER)
32
32
set (bootmode CONFIG_BOOT_FIRMWARE_LOADER)
33
+
34
+ if (SB_CONFIG_MCUBOOT_MODE_FIRMWARE_UPDATER_BOOT_MODE_ENTRANCE)
35
+ set_config_bool(${ZCMAKE_APPLICATION} CONFIG_RETAINED_MEM y)
36
+ set_config_bool(${ZCMAKE_APPLICATION} CONFIG_RETENTION y)
37
+ set_config_bool(${ZCMAKE_APPLICATION} CONFIG_RETENTION_BOOT_MODE y)
38
+ set_config_bool(${ZCMAKE_APPLICATION} CONFIG_BOOT_FIRMWARE_LOADER_BOOT_MODE y)
39
+ endif ()
33
40
endif ()
34
41
35
42
foreach (loopbootmode ${bootmodes} )
Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2025 Nordic Semiconductor
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ # This sysbuild CMake file sets the sysbuild controlled settings as properties
6
+ # on a firmware updater image.
7
+
8
+ set_config_bool(${ZCMAKE_APPLICATION} CONFIG_BOOTLOADER_MCUBOOT "${SB_CONFIG_BOOTLOADER_MCUBOOT} " )
9
+ set_config_string(${ZCMAKE_APPLICATION} CONFIG_MCUBOOT_SIGNATURE_KEY_FILE
10
+ "${SB_CONFIG_BOOT_SIGNATURE_KEY_FILE} "
11
+ )
12
+ set_config_string(${ZCMAKE_APPLICATION} CONFIG_MCUBOOT_ENCRYPTION_KEY_FILE
13
+ "${SB_CONFIG_BOOT_ENCRYPTION_KEY_FILE} "
14
+ )
15
+
16
+ if ("${SB_CONFIG_SIGNATURE_TYPE} " STREQUAL "NONE" )
17
+ set_config_bool(${ZCMAKE_APPLICATION} CONFIG_MCUBOOT_GENERATE_UNSIGNED_IMAGE y)
18
+ else ()
19
+ set_config_bool(${ZCMAKE_APPLICATION} CONFIG_MCUBOOT_GENERATE_UNSIGNED_IMAGE n)
20
+ endif ()
21
+
22
+ set_config_bool(${ZCMAKE_APPLICATION} CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER y)
Original file line number Diff line number Diff line change @@ -41,5 +41,12 @@ if(SB_CONFIG_BOOTLOADER_MCUBOOT)
41
41
set_config_int(${ZCMAKE_APPLICATION} CONFIG_FLASH_SIZE 0)
42
42
elseif (SB_CONFIG_MCUBOOT_MODE_FIRMWARE_UPDATER)
43
43
set_config_bool(${ZCMAKE_APPLICATION} CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER y)
44
+
45
+ if (SB_CONFIG_MCUBOOT_MODE_FIRMWARE_UPDATER_BOOT_MODE_ENTRANCE)
46
+ set_config_bool(${ZCMAKE_APPLICATION} CONFIG_REBOOT y)
47
+ set_config_bool(${ZCMAKE_APPLICATION} CONFIG_RETAINED_MEM y)
48
+ set_config_bool(${ZCMAKE_APPLICATION} CONFIG_RETENTION y)
49
+ set_config_bool(${ZCMAKE_APPLICATION} CONFIG_RETENTION_BOOT_MODE y)
50
+ endif ()
44
51
endif ()
45
52
endif ()
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ ExternalZephyrProject_Add(
12
12
13
13
# This allows for MCUboot to be included.
14
14
sysbuild_add_subdirectory(bootloader)
15
+ sysbuild_add_subdirectory(firmware_loader)
15
16
16
17
# Include zephyr modules generated sysbuild CMake file.
17
18
foreach (SYSBUILD_CURRENT_MODULE_NAME ${SYSBUILD_MODULE_NAMES} )
Original file line number Diff line number Diff line change 3
3
# SPDX-License-Identifier: Apache-2.0
4
4
5
5
rsource "bootloader/Kconfig"
6
+ rsource "firmware_loader/Kconfig"
Original file line number Diff line number Diff line change @@ -128,6 +128,14 @@ config MCUBOOT_MODE_FIRMWARE_UPDATER
128
128
129
129
endchoice
130
130
131
+ config MCUBOOT_MODE_FIRMWARE_UPDATER_BOOT_MODE_ENTRANCE
132
+ bool "Firmware updater retention boot mode entrance"
133
+ depends on MCUBOOT_MODE_FIRMWARE_UPDATER
134
+ help
135
+ Will enable retained memory, retention and the boot mode module in MCUboot and the main
136
+ application so that it can be used to force booting the firmware loader application
137
+ image. This needs the ``zephyr,boot-mode`` chosen node to be correctly configured.
138
+
131
139
config SIGNATURE_TYPE
132
140
string
133
141
default "NONE" if BOOT_SIGNATURE_TYPE_NONE
Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2025 Nordic Semiconductor
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ if (SB_CONFIG_FIRMARE_LOADER_IMAGE_PATH)
6
+ ExternalZephyrProject_Add(
7
+ APPLICATION ${SB_CONFIG_FIRMARE_LOADER_IMAGE_NAME}
8
+ SOURCE_DIR ${SB_CONFIG_FIRMARE_LOADER_IMAGE_PATH}
9
+ APP_TYPE FIRMWARE_LOADER
10
+ )
11
+ endif ()
Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2025 Nordic Semiconductor
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ config SUPPORT_FIRMWARE_LOADER_SMP_SVR
6
+ bool
7
+ default y
8
+
9
+ choice FIRMWARE_LOADER
10
+ prompt "Firmware loader image"
11
+ default FIRMWARE_LOADER_IMAGE_NONE
12
+ depends on MCUBOOT_MODE_FIRMWARE_UPDATER
13
+
14
+ config FIRMWARE_LOADER_IMAGE_NONE
15
+ bool "None"
16
+ help
17
+ Do not Include a firmware loader image in the build.
18
+
19
+ config FIRMWARE_LOADER_IMAGE_SMP_SVR
20
+ bool "smp_svr"
21
+ depends on SUPPORT_FIRMWARE_LOADER_SMP_SVR
22
+ help
23
+ Include the MCUmgr ``smp_svr`` sample as the firmware loader image to use.
24
+
25
+ endchoice
26
+
27
+ config FIRMARE_LOADER_IMAGE_NAME
28
+ string
29
+ default "smp_svr" if FIRMWARE_LOADER_IMAGE_SMP_SVR
30
+ help
31
+ Name of firmware loader image.
32
+
33
+ config FIRMARE_LOADER_IMAGE_PATH
34
+ string
35
+ default "${ZEPHYR_BASE}/samples/subsys/mgmt/mcumgr/smp_svr" if FIRMWARE_LOADER_IMAGE_SMP_SVR
36
+ help
37
+ Source directory of firmware loader image.
You can’t perform that action at this time.
0 commit comments