Commit graph

13 commits

Author SHA1 Message Date
Jamie McCrae f4ddca5dca sysbuild: Check for duplicate image names
Checks if the IMAGES variable has been updated with a duplicate
image name, which would otherwise cause an infinite loop.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-01-13 12:00:57 +01:00
Jamie McCrae ce31799c73 sysbuild: Allow board revisions to be specified for targets
Allows specifying board revisions when configuring target images
with sysbuild.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-01-12 12:44:53 +01:00
Torsten Rasmussen fe3efbc6a2 cmake: BOARD_REVISION_CONFIG setting for Kconfig revision fragments
Fixes: #53696

Create a BOARD_REVISION_CONFIG setting to be consistent with the
BOARD_DEFCONFIG setting.

This allows systems which re-uses the Kconfig module to overrule the
file to be used as BOARD_REVISION_CONFIG in same way as is done for
the BOARD_DEFCONFIG file.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-01-11 08:10:45 -08:00
Torsten Rasmussen 3b32444f10 sysbuild: shared cache variable instead of local scope variable
Fixes: #52353

If a CMake variable is available in both local scope and as CMake cache
variable, then the use of `${<var>}` fetches the local scoped variable.
If only the cache variable is set, then things works as expected.

Ensure that the cached variable is always the variable being shared to
images by using `$CACHE{<var>}` instead.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-12-27 12:44:19 +01:00
Jamie McCrae b65699cc4a cmake: sysbuild: Add support for recurive target cmake inclusion
Adds support for all sysbuild targets to have a sysbuild.cmake file
included and processed as part of sysbuild instead of just the main
application.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-11-03 13:04:08 +01:00
Torsten Rasmussen e0fb04458f cmake: sysbuild: import image kconfig settings to image target
Load image kconfig setting into image target properties.
This allows sysbuild to evaluate and check image configuration as part
of CMake invocation.

sysbuild_get() is updated to support reading of CMake cache or Kconfig
settings for an image.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-11-02 15:42:23 +09:00
Torsten Rasmussen 303c1eb60c sysbuild: support sample configuration of extra images
This commit introduces the possibility of a sample to locate
configuration files for extra images that are used when building with
MCUboot.

This allows use-cases where a sample, A, want to include MCUboot but has
adjustments to the default MCUboot configuration.

By adding a Kconfig fragment `<sample>/sysbuild/mcuboot.conf`, then that
fragment will be used together with the default configuration for
MCUboot.

It is also possible to completely replace the MCUboot configuration.
This is done by creating `<sample>/sysbuild/mcuboot/` folder.
This folder will then be used as the `APPLICATION_CONFIG_DIR` when
building MCUboot.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-10-18 14:13:27 +02:00
Torsten Rasmussen 8941aebc49 sysbuild: support loading of CMakeCache from Zephyr projects
This commit loads the CMakeCache of Zephyr projects.

This allows sysbuild to fetch information from Zephyr projects into
sysbuild itself.

This commit is a first step in the process of sharing more knowledge
between images and sysbuild, and pave the way for closer sharing of
settings between images.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-10-12 18:42:01 +02:00
Torsten Rasmussen 88ae9cbb9d cmake: extend zephyr_get() to handle build configurations from sysbuild
Enhance sysbuild controlled configurations.

The current scheme of passing settings using `-D` on the CMake
invocation is vulnerable to quoting and lists.

With `zephyr_get()` in place as a uniform way of handling user
controlled settings (CMake cache / environment / CMake local variable)
we have a mechanism in place for a cleaner handling of sysbuild
controlled settings.

This improves the robustness of variable passing and add the same cleans
up and simplifies the logic in sysbuild.

The Kconfig Zephyr CMake module has been updated accordingly so that
CONFIG settings are taken from the sysbuild shadow cache when sysbuild
is used as higher level build system.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-09-02 15:16:50 +02:00
Torsten Rasmussen b88c8e1363 cmake: sysbuild: signing support
This commit introduces image signing by adding the possibility to
specify algorithm and signing key for sysbuild images.

It introduces Kconfig setting to specify signing algorithm and key file.

It will default the signing key to the default key provided by MCUBoot
if no key has been specified.

When signing is enabling, the signature key will be passed to the
application so the build system can sign the image as post build step.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-08-03 16:05:07 +02:00
Torsten Rasmussen 598bea0899 cmake: create domains.yaml
Support creation of domains.yaml to support
`west <build|flash|debug> --domain` when working with sysbuild multi
image.

Each Zephyr based image is added to list of domain that can be handled
by the Zephyr west extension commands.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-08-03 16:05:07 +02:00
Torsten Rasmussen 3d520dde2b 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>
2022-08-03 16:05:07 +02:00
Torsten Rasmussen 9d6cc39d6f cmake: initial sysbuild / multi image support
This is the initial commit with system build, sysbuild.

Using CMake as infrastructure together with the Zephyr sysbuild allows
us to support a convenient way of building a sample and allow for extra
images to be built as part of a larger system.

It uses Kconfig for configuration of image builds.
This allows for future extension with additional build images.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-08-03 16:05:07 +02:00