cmake: support MCUBoot bootloader natively with SYSBuild
This commit adds CMake and Kconfig files needed to build MCUboot as an extra image using SYSBuild. Building an application with MCUBoot using SYSBuild allows users to build both images using a single build. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
parent
9d6cc39d6f
commit
3d520dde2b
4 changed files with 44 additions and 0 deletions
|
@ -37,6 +37,8 @@ ExternalZephyrProject_Add(
|
||||||
MAIN_APP
|
MAIN_APP
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_subdirectory(bootloader)
|
||||||
|
|
||||||
# This allows for board and app specific images to be included.
|
# This allows for board and app specific images to be included.
|
||||||
include(${BOARD_DIR}/sysbuild.cmake OPTIONAL)
|
include(${BOARD_DIR}/sysbuild.cmake OPTIONAL)
|
||||||
include(${APP_DIR}/sysbuild.cmake OPTIONAL)
|
include(${APP_DIR}/sysbuild.cmake OPTIONAL)
|
||||||
|
|
|
@ -32,3 +32,5 @@ config WARN_DEPRECATED
|
||||||
help
|
help
|
||||||
Print a warning when the Kconfig tree is parsed if any deprecated
|
Print a warning when the Kconfig tree is parsed if any deprecated
|
||||||
features are enabled.
|
features are enabled.
|
||||||
|
|
||||||
|
rsource "bootloader/Kconfig"
|
||||||
|
|
11
share/sysbuild/bootloader/CMakeLists.txt
Normal file
11
share/sysbuild/bootloader/CMakeLists.txt
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# Copyright (c) 2022 Nordic Semiconductor
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
# Include MCUboot if enabled.
|
||||||
|
if(SB_CONFIG_BOOTLOADER_MCUBOOT)
|
||||||
|
ExternalZephyrProject_Add(
|
||||||
|
APPLICATION mcuboot
|
||||||
|
SOURCE_DIR ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/
|
||||||
|
)
|
||||||
|
endif()
|
29
share/sysbuild/bootloader/Kconfig
Normal file
29
share/sysbuild/bootloader/Kconfig
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
# Copyright (c) 2022 Nordic Semiconductor
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
config SUPPORT_BOOTLOADER
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
|
config SUPPORT_BOOTLOADER_MCUBOOT_ZEPHYR
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
|
choice BOOTLOADER
|
||||||
|
prompt "Bootloader support"
|
||||||
|
default BOOTLOADER_NONE
|
||||||
|
depends on SUPPORT_BOOTLOADER
|
||||||
|
|
||||||
|
config BOOTLOADER_NONE
|
||||||
|
bool "None"
|
||||||
|
help
|
||||||
|
Do not Include a bootloader in the build
|
||||||
|
|
||||||
|
config BOOTLOADER_MCUBOOT
|
||||||
|
bool "MCUboot"
|
||||||
|
depends on SUPPORT_BOOTLOADER_MCUBOOT_ZEPHYR
|
||||||
|
help
|
||||||
|
Include MCUboot (Zephyr port) as the bootloader to use
|
||||||
|
|
||||||
|
endchoice
|
Loading…
Add table
Add a link
Reference in a new issue