Commit graph

145 commits

Author SHA1 Message Date
Jamie McCrae
01cf5768a0 sysbuild: cmake: Use supplied image for variant source image
Fixes wrongly using the default image instead of the supplied
user image in the variant image function

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-03-16 19:06:50 -05:00
Torsten Rasmussen
f6aff5b460 cmake: align SNIPPET_ROOT with other Zephyr '<type>_ROOT' lists
Zephyr `<type>_ROOT`s, such as `BOARD_ROOT`, `DTS_ROOT`, `SCA_ROOT`,
are initialed by ROOT settings provided through CMake variable
`<type>_ROOT`, Zephyr base, and root settings specified in Zephyr
module's `zephyr/module.yml` file.

`SNIPPET_ROOT` didn't follow the same pattern as it also included
application source dir.

This commit aligns `SNIPPET_ROOT` to follow same principle for
constructing other Zephyr `<type>_ROOT` lists.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2026-02-03 13:08:20 +01:00
Torsten Rasmussen
3a31002dd7 sysbuild: use ZEPHYR_SHARED_TARGETS instead of hard-coded targets
Remove the hard-coded target knowledge of menuconfig, hardenconfig, and
guiconfig and instead use the ZEPHYR_SHARED_TARGETS provided by the
Zephyr image.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2026-01-27 08:39:52 -05:00
Torsten Rasmussen
a0983a2f91 cmake: align board qualifiers in CMake with Kconfig
The value os board qualifiers in CMake and Kconfig differs.
CMake has a leading '/', as example:
CMake:   BOARD_QUALIFIERS=/nrf52840
Kconfig: BOARD_QUALIFIERS=nrf52840

This was also discussed in
https://github.com/zephyrproject-rtos/zephyr/pull/69740

This commit aligns the value of the CMake variable BOARD_QUALIFIERS to
the value of BOARD_QUALIFIERS (CONFIG_BOARD_QUALIFIERS) in Kconfig.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2026-01-27 10:52:37 +00:00
Jamie McCrae
ec19a0d649 sysbuild: Only load Kconfig/dts image files if they exist
If they do not exist, do not load them

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-26 10:15:13 -06:00
Jamie McCrae
5ccfb179f0 sysbuild: Link MCUboot output with main app configuration
Links the output from the default MCUboot build with the estimated
size of the overhead with the main image. This also allowes used
to remove the linkage between them, if they so wish

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-26 14:17:06 +01:00
Jamie McCrae
8312b20ca9 sysbuild: Add ability to generate slot 1 variant image
Adds a new experimental Kconfig option to sysbuild which allows
generating a variant image to use with MCUboot in direct-xip mode.
It also includes base sysbuild infrastructure for creating
additional variant images in future (including out-of-tree),
whereby they use the base configuration of an existing image but
modify it, without creating the default zephyr extra targets for
images (e.g. menuconfig) to prevent changing configuration that
should not be changed.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-20 15:31:06 +00:00
Wilfried Chauveau
b25ecfd358 cmake: sysbuild: propagate WEST_PYTHON & Python3_EXECUTABLE
Without this, the parent CMake and the sub-processes may use different
Python environment.

Co-authored-by: Torsten Tejlmand Rasmussen <torsten.rasmussen@nordicsemi.no>
Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2026-01-19 12:20:01 +01:00
Jamie McCrae
feadf2e8ef sysbuild: Add optional output merged hex file support
Adds support for generated merged hex file output, one hex file
per unique board target. This feature can be enabled with
SB_CONFIG_MERGED_HEX_FILES

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-12 11:52:58 +01:00
Fabrice DJIATSA
b152f71aaa modules: kconfig: mcuboot: make SWAP_USING_OFFSET the default for STM32
Update MCUboot configuration so that STM32 no longer defaults to
SWAP_USING_MOVE. Instead, SWAP_USING_OFFSET becomes the default mode
for STM32 boards.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-12-15 17:08:14 +00:00
Jamie McCrae
356f992f68 sysbuild: cmake: Only touch empty conf file if it does not exist
Prevents a random occurance whereby sysbuild reconfigures itself
after a reconfiguration for no known discernable reason

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2025-12-06 11:38:41 -05:00
Josuah Demangeon
0c4ab40921 style: share: apply coding style on CMakeLists.txt files
Apply the CMake style guidelines to CMakeList.txt files in share/.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-11-17 13:48:03 -05:00
Torsten Rasmussen
f26d245914 sysbuild: exclude APPLICATION_SOURCE_DIR from sysbuild image cache file
APPLICATION_SOURCE_DIR is image specific and the value inside sysbuild
points to sysbuild itself.

This gives wrong results when a sample uses
`zephyr_get(APPLICATION_SOURCE_DIR)` as it will fetch the sysbuild value
and not its own value.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-11-13 23:15:45 +02:00
Jamie McCrae
e341b0e481 sysbuild: bootloader: Remove deprecated Kconfig
Removes the previously deprecated
SB_CONFIG_MCUBOOT_MODE_SWAP_WITHOUT_SCRATCH sysbuild Kconfig

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-11-13 23:09:55 +02:00
Anas Nashif
303af992e5 style: fix 'if (' usage in cmake files
Replace with 'if(' and 'else(' per the cmake style guidelines.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-29 11:44:13 +02:00
Torsten Rasmussen
b88e615339 sysbuild: support application CMakePresets.json files with sysbuild
This commit provides a CMakePresets.json which includes the sample's
CMakePresets.json file.

`west build` is extended to set `APP_DIR` in environment when sysbuild
is used. This allows sysbuild's CMakePresets.json to include the
sample's presets file.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-10-03 12:51:01 +03:00
Jamie McCrae
f624525f30 kconfig: Load Kconfig env file better
Loads this file in a better way that means samples and modules
should not have to source the file before referencing Kconfig
module path variables

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-09-12 13:19:56 +02:00
Jamie McCrae
72c4af32d3 cmake: Rename option variable
Renames a variable used in a macro to avoid collisions in picolibc

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-09-05 12:27:19 +02:00
Sylvio Alves
0a339a2d7b mcuboot: kconfig: set default MOVE for Espressif SoCs
Make sure default MOVE option is enabled for Espressif SoCs.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-09-05 09:31:37 +02:00
Benjamin Cabé
0132ea07fb doc: fix spelling errors tree-wide
fix some spelling errors in code comments and Kconfig helps

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Jamie McCrae
4977c5cef9 scripts/kconfig/cmake: Generate/use env file for zephyr module paths
Adds a output env file that lists the paths of zephyr modules
which can be used in Kconfig files and uses this in Kconfig. Also
updates Kconfig doc output to generate and use this

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-09-03 11:03:40 +02:00
Jamie McCrae
db8f991c77 kconfig: Use $(...) instead of ${...} for getting variables
Updates this to comply with the Zephyr Kconfig recommendations

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-08-20 12:05:41 +02:00
Artur Hadasz
b43ce97c6b bootloader: mcuboot: Fix encryption not being selected in bootloader
In some cases this resulted in the device not booting.

Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
2025-08-18 10:54:37 +02:00
Artur Hadasz
9a1fe30199 bootloader: mcuboot: Changes needed to support AES256
This commit adds changes which are necessary to support
the AES256 encryption algorithm in mcuboot.

Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
2025-08-12 12:35:31 +02:00
Daniel DeGrasse
879d4ce7f3 modules: mcuboot: add Kconfigs for RAMLOAD_WITH_REVERT mode
Add Kconfigs for RAMLOAD_WITH_REVERT mode in MCUBoot. This mode works in
a manner similar to DIRECT_XIP_WITH_REVERT- namely, mcuboot will only
boot an image that is either confirmed or marked as pending. If both
images are confirmed, mcuboot will still select the one with the higher
version, so downgrading is not possible using this mode.

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-08-05 11:53:58 +01:00
Jamie McCrae
7a76a6238d sysbuild: Default to swap using offset for MCUboot
This swapping method is more efficient than swap using move and
has been available for some time, remove experimental flag and
set it as the default except for stm32 devices which have
partition alignment for swap using move

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-07-30 06:19:53 -04:00
Flavio Ceolin
674fd094aa build: kconfig: Add support for warning insecure features
Add a new promptless Kconfig symbol (INSECURE). This symbols must
be selected by any setting which is used to enable an insecure
feature.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-07-10 16:00:26 -05:00
Jamie McCrae
c8d9f4b701 sysbuild: cmake: kconfig: Fix missing sysbuild Kconfig paths
Fixes an issue where external sysbuild Kconfig path variables
were not provided and meant they could not be overwritten

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-07-07 10:14:14 -05:00
Pisit Sawangvonganan
a163f9db61 kconfig: fix typo in (arch, boards, kernel, modules, samples, share)
Utilize a code spell-checking tool to scan for and correct spelling errors
in `Kconfig` files within the `arch`, `boards`, `kernel`, `modules`,
`samples`, and `share` directory.
Additionally, incorporates a fix recommended by the reviewer.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-07-01 10:58:54 -10:00
Tomasz Chyrowicz
13a0f0504c sysbuild: Allow to use file suffix DTS overlays
Allow to add an image-specific DTS overlay, that is applied based on the
FILE_SUFFIX.
Up to this point, it was possible to specify such Kconfig files
(sysbuild/<image>_<file_suffix>.conf),
but it did not work with dts overlays
(sysbuild/<image>_<file_suffix>.overlay).
This commit aligns the logic of finding configuration files for both
scenarios mentioned above.

Ref: NCSDK-NONE

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-06-10 12:13:10 +02:00
Grzegorz Swiderski
da197fe9ef sysbuild: Import image devicetrees
Make the image devicetrees available to sysbuild for advanced use cases.

This is done by calling `zephyr_dt_import` on each image target. The DT
target properties are all expected to be prefixed with `DT_`, so there
should be no conflicts.

Thus, the DT contents of a given `<image>` can be retrieved using e.g.:

    dt_nodelabel(<var> NODELABEL <label> TARGET <image>)

as noted in `extensions.cmake`.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-05-22 13:44:18 +02:00
Jamie McCrae
a1e66b4952 sysbuild: image_configurations: Add firmware loader dtc overlay file
Adds a devicetree overlay file for the firmware loader image which
sets the code partition to slot 1, which is where the firmware loader
image resides

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-05-16 21:37:01 +02:00
Jamie McCrae
1e73b581c6 sysbuild: Add support for image configuration dtc overlay files
Adds support for using image-specific configuration devicetree
overlay files

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-05-16 21:37:01 +02:00
Jamie McCrae
8a8b91843d sysbuild: Add firmware loader application type support
Adds support for setting up a firmware loader image in a build,
which can also optionally automatically configure MCUboot and the
application image to be able to boot the firmware loader image
using the retention subsystem

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-04-25 14:03:34 +02:00
Ederson de Souza
e420b21834 share/sysbuild: Support single app slot RAM load mode
Adds a new Kconfig to support MCUboot single application slot RAM load
mode.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-04-08 16:12:33 +02:00
Jamie McCrae
9f12f8afb2 infrastructure: Remove hwmv1 support
Removes support for the deprecated hardware model version 1

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-03-13 16:53:07 +00:00
Jamie McCrae
29217b48a5 sysbuild: mcuboot: Add support for swap using offset mode
Adds a new Kconfig to allow selecting this newly introduced MCUboot
swapping algorithm

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-02-10 19:05:25 +01:00
Jamie McCrae
55dba488a4 sysbuild: Update MCUboot swap using move Kconfig name
Deprecates the old Kconfig and adds a new one which lines up with
the name of the Kconfig used by MCUboot

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-02-10 19:05:25 +01:00
Torsten Rasmussen
642e9484e3 sysbuild: populate build_info with list of images
Populate the build_info.yml created by sysbuild CMake with list of
images and write the build info file afterwards.

This allows users and external tools to examine which images was
included in the build even if one or more of those images fails CMake
configure or generate stage.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-02-10 15:56:52 +00:00
Benjamin Cabé
5b988356ec Revert "sysbuild: populate build_info with list of images"
This reverts commit f67939bf7e.
as it's part of a series of commits causing issues on Windows

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-01-29 09:27:31 +01:00
Torsten Rasmussen
f67939bf7e sysbuild: populate build_info with list of images
Populate the build_info.yml created by sysbuild CMake with list of
images and write the build info file afterwards.

This allows users and external tools to examine which images was
included in the build even if one or more of those images fails CMake
configure or generate stage.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-01-27 13:24:23 +01:00
Grzegorz Swiderski
17ba479585 sysbuild: Fix Kconfig symbol SIGNATURE_TYPE
Add missing quotes around string values, so that they won't be
interpreted as undefined symbol names.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-01-17 16:35:53 +01:00
Jamie McCrae
aed59d4431 sysbuild: cmake: modules: kconfig: Fix changed CMake API
Fixes a bug which was caused by the CMake function API having
changed in commit 4e29a35b22

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-12-27 10:51:56 +01:00
Jamie McCrae
0711f42e3a sysbuild: Add support for snippets
Adds support for sysbuild loading snippets, these can be included
by using e.g.: cmake ... -DSB_SNIPPET=blah for sysbuild
directly or can be used with an application and sysbuild using
-DSNIPPET. Snippets for sysbuild can use SB_EXTRA_CONF_FILE in the
snippet file to specify an extra Kconfig fragment for sysbuild

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-12-27 07:18:13 +01:00
Jamie McCrae
f277631b60 sysbuild: Add missing option for MCUboot encryption support
Adds a missing 'default y' for the Kconfig option indicating that
encryption is supported with the current configuration

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-10-30 08:54:33 -05:00
Torsten Rasmussen
536d34fa7a cmake: scripts: support board extension
Fixes: #69548

Support extending an existing board with new board variants.

This commit introduces the following changes to allow a board to be
extended out-of-tree.

The board yaml schema is extended to support an extend field which
will be used to identify the board to be extended.

A board 'plank' can be extended like this:
> board:
>   extend: plank
>   variants:
>     - name: ext
>       qualifier: soc1

For the rest of the build system this means that there is no longer a
single board directory.
The existing CMake variable BOARD_DIR is kept and reference the
directory which defines the board.
A new CMake variable BOARD_DIRECTORIES provides a list of all
directories which defines board targets for the board.
This means the directory which defines the board as well as all
directories that extends the board.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-10-26 17:14:06 +02:00
Jamie McCrae
9e1b3bbb65 sysbuild: images: bootloader: kconfig: Limit encryption
Limits selecting the encryption option to MCUboot operating modes
that support it

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-10-23 16:53:05 +02:00
Jamie McCrae
3406515f12 sysbuild: images: bootloader: Add RAM load note
Adds a note about MCUboot RAM requirements for this

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-10-11 13:19:39 -04:00
Jamie McCrae
646f116cca mcuboot: Add support for RAM load mode
Adds supporting code that allows the RAM load mode of MCUboot to
be used and for applications to build successfully with it.
Sysbuild can be used to build images for this mode

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-10-11 13:19:39 -04:00
Jamie McCrae
8774f15bd2 sysbuild: cmake: Add set_config_int() function
Adds a function that will add an integer value to an image

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-10-11 13:19:39 -04:00