Skip to content

Commit e420b21

Browse files
edersondisouzakartben
authored andcommitted
share/sysbuild: Support single app slot RAM load mode
Adds a new Kconfig to support MCUboot single application slot RAM load mode. Signed-off-by: Ederson de Souza <[email protected]>
1 parent c9a18fd commit e420b21

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

scripts/ci/check_compliance.py

+1
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,7 @@ def check_no_undef_outside_kconfig(self, kconf):
11011101
"SEL",
11021102
"SHIFT",
11031103
"SINGLE_APPLICATION_SLOT", # Used in sysbuild for MCUboot configuration
1104+
"SINGLE_APPLICATION_SLOT_RAM_LOAD", # Used in sysbuild for MCUboot configuration
11041105
"SOC_SERIES_", # Used as regex in scripts/utils/board_v1_to_v2.py
11051106
"SOC_WATCH", # Issue 13749
11061107
"SOME_BOOL",

share/sysbuild/image_configurations/BOOTLOADER_image_default.cmake

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ set(bootmodes CONFIG_SINGLE_APPLICATION_SLOT
1212
CONFIG_BOOT_SWAP_USING_MOVE
1313
CONFIG_BOOT_DIRECT_XIP
1414
CONFIG_BOOT_RAM_LOAD
15-
CONFIG_BOOT_FIRMWARE_LOADER)
15+
CONFIG_BOOT_FIRMWARE_LOADER
16+
CONFIG_SINGLE_APPLICATION_SLOT_RAM_LOAD)
1617

1718
if(SB_CONFIG_MCUBOOT_MODE_SINGLE_APP)
1819
set(bootmode CONFIG_SINGLE_APPLICATION_SLOT)
@@ -30,6 +31,8 @@ elseif(SB_CONFIG_MCUBOOT_MODE_RAM_LOAD)
3031
set(bootmode CONFIG_BOOT_RAM_LOAD)
3132
elseif(SB_CONFIG_MCUBOOT_MODE_FIRMWARE_UPDATER)
3233
set(bootmode CONFIG_BOOT_FIRMWARE_LOADER)
34+
elseif(SB_CONFIG_MCUBOOT_MODE_SINGLE_APP_RAM_LOAD)
35+
set(bootmode CONFIG_SINGLE_APPLICATION_SLOT_RAM_LOAD)
3336
endif()
3437

3538
foreach(loopbootmode ${bootmodes})

share/sysbuild/image_configurations/MAIN_image_default.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@ if(SB_CONFIG_BOOTLOADER_MCUBOOT)
4141
set_config_int(${ZCMAKE_APPLICATION} CONFIG_FLASH_SIZE 0)
4242
elseif(SB_CONFIG_MCUBOOT_MODE_FIRMWARE_UPDATER)
4343
set_config_bool(${ZCMAKE_APPLICATION} CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER y)
44+
elseif(SB_CONFIG_MCUBOOT_MODE_SINGLE_APP_RAM_LOAD)
45+
set_config_bool(${ZCMAKE_APPLICATION} CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP_RAM_LOAD y)
4446
endif()
4547
endif()

share/sysbuild/images/bootloader/Kconfig

+13
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,19 @@ config MCUBOOT_MODE_FIRMWARE_UPDATER
126126
mechanism defined for entering the slot1_partition which is a dedicated firmware updater
127127
application used to update the slot0_partition application.
128128

129+
config MCUBOOT_MODE_SINGLE_APP_RAM_LOAD
130+
bool "Single app RAM load mode"
131+
help
132+
MCUboot can load the image to RAM from an arbitrary location. In this mode,
133+
MCUboot will copy the image to RAM and begin execution from there. The image
134+
must be linked to execute from RAM, the address that it is copied to is
135+
specified using the load-addr argument when running imgtool.
136+
Note that while not used directly, a slot0_partition must be defined in the
137+
DT, as it is used to get information about size of the image to be loaded.
138+
This option automatically selects MCUBOOT_BOOTLOADER_NO_DOWNGRADE as it is
139+
not possible to swap back to older version of the application. In fact, none
140+
of the swap operations are supported in this mode.
141+
129142
endchoice
130143

131144
config SIGNATURE_TYPE

0 commit comments

Comments
 (0)