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>
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>
This commit adds changes which are necessary to support
the AES256 encryption algorithm in mcuboot.
Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Store informations regarding the current Zephyr build.
The following informations are stored during CMake configure:
- Board information
- Application source directory
- Application configuration directory
- Toolchain information
- Devicetree files
- Kconfig config files
- Zephyr version
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Fixes an issue with HWMv2 boards whereby the specified board
revision was not applied at the correct place, which would cause
the target image to fail configuration
Fixes#79208
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Zephyr provides a feature to hook in custom menuconfig implementations
by setting EXTRA_KCONFIG_TARGETS and then defining the corresponding
command to invoke as EXTRA_KCONFIG_TARGET_COMMAND_FOR_<target>.
This feature is broken with sysbuild because sysbuild will try to create
multiple custom targets with identical names.
This commit fix the sysbuild handling of extra kconfig targets.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Initial CMake yaml module to facilitate reading yaml files into CMake,
update yaml settings and write it back to a file.
The yaml module also supports creation of yaml files from scratch.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Adds a sysbuild Kconfig to select the operating mode of MCUboot
which is then propagated to the MCUboot and application images
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Check for existence of APPLICATION_CONFIG_DIR in sysbuild.
sysbuild.conf is an optional file, meaning that sysbuild will not fail
if APPLICATION_CONFIG_DIR points to a non-existing folder.
A normal Zephyr build already fails when passing an invalid
APPLICATION_CONFIG_DIR but only because it cannot find a required
prj.conf in the folder.
Checking the existence of APPLICATION_CONFIG_DIR in sysbuild and fail
the build when a non-existing folder is passed to sysbuild ensures
sysbuild behaves similar to a normal Zephyr build regarding a
non-existing folder, while still allow sysbuild.conf itself to be
optional.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The sysbuild part of sysbuild/application creates a sysbuild/application
folder under top-level build dir. However, having a sysbuild folder at
this level means that tab completion for sysbuild pre-fixed build
targets will stop after completing just `sysbuild` and then show several
subfolders, making it hard to see important build targets, such as:
`ninja sysbuild_menuconfig`.
As `sysbuild/application` is just a folder name, then move it to
`_sysbuild` instead to avoid impacting tab completion for ninja and
make.
Also strip the `application` part in the process, as the extra folder
doesn't provide any extra benefit, but is just one more level to enter
when browsing the build folder structure.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
If not defined by caller, then set APPLICATION_BINARY_DIR to
CMAKE_CURRENT_BINARY_DIR. This is normally be done by
`find_package(Zephyr)`, but due to the indirection introduced with
fc1884ecf5 to allow applications to
provide their own sysbuild entry point, then the APPLICATION_BINARY_DIR
is unexpectedly set to the bin dir of the entry point.
Restore the old behavior so that APPLICATION_BINARY_DIR per default
again points to top-level sysbuild binary dir.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Sysbuild sets the EXTRA_CONF_FILE before loading kconfig.cmake.
This hides any user defined EXTRA_CONF_FILE added to the sysbuild cache.
Clear the local sysbuild EXTRA_CONF_FILE so that the hidden cache
variable re-enters current scope.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Fixes an issue whereby strings are placed in UTF-8 format but the
application doesn't read them in when configured using sysbuild
and another issue whereby sysbuild then reads the application's
cache and did not treat them as UTF-8
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Fixes: #73066
Introduce sysbuild_root CMake module similar to the Zephyr root CMake
module. The sysbuild_root CMake module works similar to existing root
module, but with the difference that root paths are adjusted relative to
APP_DIR which is the main image, instead of relative to sysbuild.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Fixes: #73065
Update APPLICATION_CONFIG_DIR is Zephyr CMake and sysbuild to follow
the common principle in Zephyr for relative paths.
This means that relative paths are taken from the application source
directory when specified on command line, and require local scoped
defined APPLICATION_CONFIG_DIR to be given as absolute, for example by
using CMAKE_CURRENT_LIST_DIR.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
APPLICATION_CONFIG_DIR is supported in Zephyr and allows to adjust the
location from which prj.conf and friends are picked up.
This also works for images when using sysbuild, however sysbuild itself
ignores the value of APPLICATION_CONFIG_DIR, meaning that sysbuild only
accepts sysbuild.conf located directly in the sample folder.
Extend sysbuild to support APPLICATION_CONFIG_DIR so sysbuild follows
regular Zephyr CMake behavior.
Introduce SB_APPLICATION_CONFIG_DIR to allow changing the location
for sysbuild only, without propagating the value to images.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit refactors sysbuild entry code by creating a CMake sysbuild
module for image processing and place sysbuild entry code in a
<app>/sysbuild/CMakeLists.txt file.
A template/CMakeLists.txt file will be use as template for applications
which doesn't provide their own entry file.
An application may create a sysbuild/CMakeLists.txt file.
The sysbuild/CMakeLists.txt file is similar in nature to the
toplevel CMakeLists.txt file but intended to used by sysbuild.
This allows application developers to adjust how an application is
built with sysbuild.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Use of ARGV1 is undefined when number of arguments to function is less
than 2. Therefore switch to ARGN which holds arguments beyond required
arguments.
If there are no optional arguments, then ARGN is just an empty list,
thus making it safe to use.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>