Skip to content

Commit

Permalink
zephyr: added address/size of bootloader/firmware shared memory area
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
m5k8 committed Jan 13, 2025
1 parent 59e9f03 commit 6c8c217
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions boot/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,22 @@ config BOOT_SHARE_BACKEND_EXTERNAL
help
Use a custom user-specified storage.

if BOOT_SHARE_BACKEND_EXTERNAL
config BOOT_SHARE_BACKEND_EXTERNAL_DATA_BASE
hex "Shared memory area base address"
depends on BOOT_SHARE_BACKEND_EXTERNAL
help
Base address of user-defined memory area shared between
bootloader and runtime firmware.

config BOOT_SHARE_BACKEND_EXTERNAL_DATA_SIZE
int "Shared memory area size in bytes"
depends on BOOT_SHARE_BACKEND_EXTERNAL
help
Size of user-defined memory area shared between
bootloader and runtime firmware.
endif

endchoice

menuconfig BOOT_SHARE_DATA
Expand Down
5 changes: 5 additions & 0 deletions boot/zephyr/include/mcuboot_config/mcuboot_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@
#define MCUBOOT_CUSTOM_DATA_SHARING_FUNCTION
#endif

#ifdef CONFIG_BOOT_SHARE_BACKEND_EXTERNAL
#define MCUBOOT_SHARED_DATA_BASE CONFIG_BOOT_SHARE_BACKEND_EXTERNAL_DATA_BASE
#define MCUBOOT_SHARED_DATA_SIZE CONFIG_BOOT_SHARE_BACKEND_EXTERNAL_DATA_SIZE
#endif

#ifdef CONFIG_BOOT_SHARE_DATA_BOOTINFO
#define MCUBOOT_DATA_SHARING_BOOTINFO
#endif
Expand Down

0 comments on commit 6c8c217

Please sign in to comment.