File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,8 @@ function(zephyr_mcuboot_tasks)
95
95
96
96
# If single slot mode, or if in firmware updater mode and this is the firmware updater image,
97
97
# use slot 0 information
98
- if (NOT CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP AND (NOT CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER OR CONFIG_MCUBOOT_APPLICATION_FIRMWARE_UPDATER ))
98
+ if (NOT CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP AND (NOT CONFIG_MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER OR CONFIG_MCUBOOT_APPLICATION_FIRMWARE_UPDATER )
99
+ AND NOT CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP_RAM_LOAD )
99
100
# Slot 1 size is used instead of slot 0 size
100
101
set (slot_size )
101
102
dt_nodelabel (slot1_flash NODELABEL "slot1_partition" REQUIRED )
@@ -138,6 +139,15 @@ function(zephyr_mcuboot_tasks)
138
139
set (imgtool_args --align 1 --load-addr ${chosen_ram_address} ${imgtool_args} )
139
140
set (imgtool_args_alt_slot ${imgtool_args} --hex-addr ${slot1_partition_address} )
140
141
set (imgtool_args ${imgtool_args} --hex-addr ${slot0_partition_address} )
142
+ elseif (CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP_RAM_LOAD )
143
+ dt_chosen (ram_load_dev PROPERTY "mcuboot,ram-load-dev" )
144
+ if (DEFINED ram_load_dev )
145
+ dt_reg_addr (load_address PATH ${ram_load_dev} )
146
+ else ()
147
+ dt_chosen (chosen_ram PROPERTY "zephyr,sram" )
148
+ dt_reg_addr (load_address PATH ${chosen_ram} )
149
+ endif ()
150
+ set (imgtool_args --align 1 --load-addr ${load_address} ${imgtool_args} )
141
151
else ()
142
152
set (imgtool_args --align ${write_block_size} ${imgtool_args} )
143
153
endif ()
Original file line number Diff line number Diff line change @@ -462,3 +462,8 @@ device.
462
462
WS2812 GPIO driver
463
463
* - zephyr,touch
464
464
- touchscreen controller device node.
465
+ * - mcuboot,ram-load-dev
466
+ - When a Zephyr application is built to be loaded to RAM by MCUboot, with
467
+ :kconfig:option: `CONFIG_MCUBOOT_BOOTLOADER_MODE_SINGLE_APP_RAM_LOAD `,
468
+ this property is used to tell MCUboot the load address of the image, which
469
+ will be the ``reg `` of the chosen node.
Original file line number Diff line number Diff line change @@ -254,6 +254,21 @@ config MCUBOOT_BOOTLOADER_MODE_FIRMWARE_UPDATER
254
254
a dedicated firmware updater application used to update the slot0_partition
255
255
application.
256
256
257
+ config MCUBOOT_BOOTLOADER_MODE_SINGLE_APP_RAM_LOAD
258
+ bool "MCUboot has been configured in single app RAM load mode"
259
+ select MCUBOOT_BOOTLOADER_MODE_HAS_NO_DOWNGRADE
260
+ select MCUBOOT_BOOTLOADER_NO_DOWNGRADE
261
+ help
262
+ MCUboot can load the image to RAM from an arbitrary location. In this mode,
263
+ MCUboot will copy the image to RAM and begin execution from there. The image
264
+ must be linked to execute from RAM, the address that it is copied to is
265
+ specified using the load-addr argument when running imgtool.
266
+ Note that while not used directly, a slot0_partition must be defined in the
267
+ DT, as it is used to get information about size of the image to be loaded.
268
+ This option automatically selects MCUBOOT_BOOTLOADER_NO_DOWNGRADE as it is
269
+ not possible to swap back to older version of the application. In fact, none
270
+ of the swap operations are supported in this mode.
271
+
257
272
endchoice # MCUBOOT_BOOTLOADER_MODE
258
273
259
274
config MCUBOOT_BOOTLOADER_MODE_HAS_NO_DOWNGRADE
You can’t perform that action at this time.
0 commit comments