Skip to content

Commit 6c8c217

Browse files
committed
zephyr: added address/size of bootloader/firmware shared memory area
Added definitions of base address and size of user-defined shared memory area between bootloader and runtime firmware, when using BOOT_SHARE_BACKEND_EXTERNAL. It's possible to select Kconfig BOOT_SHARE_BACKEND_EXTERNAL, but then mcuboot expects the following symbols: MCUBOOT_SHARED_DATA_BASE and MCUBOOT_SHARED_DATA_SIZE. There was no way to set them via KConfig and compilation fails. This patch adds KConfig symbols that give the possibility to set them. Signed-off-by: Michal Konieczny <[email protected]>
1 parent 59e9f03 commit 6c8c217

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

boot/zephyr/Kconfig

+16
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,22 @@ config BOOT_SHARE_BACKEND_EXTERNAL
512512
help
513513
Use a custom user-specified storage.
514514

515+
if BOOT_SHARE_BACKEND_EXTERNAL
516+
config BOOT_SHARE_BACKEND_EXTERNAL_DATA_BASE
517+
hex "Shared memory area base address"
518+
depends on BOOT_SHARE_BACKEND_EXTERNAL
519+
help
520+
Base address of user-defined memory area shared between
521+
bootloader and runtime firmware.
522+
523+
config BOOT_SHARE_BACKEND_EXTERNAL_DATA_SIZE
524+
int "Shared memory area size in bytes"
525+
depends on BOOT_SHARE_BACKEND_EXTERNAL
526+
help
527+
Size of user-defined memory area shared between
528+
bootloader and runtime firmware.
529+
endif
530+
515531
endchoice
516532

517533
menuconfig BOOT_SHARE_DATA

boot/zephyr/include/mcuboot_config/mcuboot_config.h

+5
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@
185185
#define MCUBOOT_CUSTOM_DATA_SHARING_FUNCTION
186186
#endif
187187

188+
#ifdef CONFIG_BOOT_SHARE_BACKEND_EXTERNAL
189+
#define MCUBOOT_SHARED_DATA_BASE CONFIG_BOOT_SHARE_BACKEND_EXTERNAL_DATA_BASE
190+
#define MCUBOOT_SHARED_DATA_SIZE CONFIG_BOOT_SHARE_BACKEND_EXTERNAL_DATA_SIZE
191+
#endif
192+
188193
#ifdef CONFIG_BOOT_SHARE_DATA_BOOTINFO
189194
#define MCUBOOT_DATA_SHARING_BOOTINFO
190195
#endif

0 commit comments

Comments
 (0)