Skip to content

Commit 6888aba

Browse files
nordicjmfabiobaltieri
authored andcommitted
doc: sysbuild: Add note on configuring board roots
Adds a note on how these should be configured Signed-off-by: Jamie McCrae <[email protected]>
1 parent 0035449 commit 6888aba

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

doc/build/sysbuild/index.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,46 @@ debug the application.
801801
.. _MCUboot with Zephyr: https://docs.mcuboot.com/readme-zephyr
802802
.. _ExternalProject: https://cmake.org/cmake/help/latest/module/ExternalProject.html
803803

804+
.. _sysbuild_var_override:
805+
806+
Configuring sysbuild internal state
807+
***********************************
808+
809+
Because sysbuild is a CMake project in it's own right, it runs and sets up itself similar to a
810+
Zephyr application but using it's own CMake code. This means that some features, for example
811+
specifying variables in an application ``CMakeLists.txt`` (such as ``BOARD_ROOT``) will not work,
812+
instead these must be set by using a :ref:`a module <modules_build_settings>` or by using a custom
813+
sysbuild project file as ``<application>/sysbuild/CMakeLists.txt``, for example:
814+
815+
.. code-block:: cmake
816+
817+
# Place pre-sysbuild configuration items here
818+
819+
# For changing configuration that sysbuild itself uses:
820+
# set(<var> <value>)
821+
# list(APPEND <list> <value>)
822+
823+
# For changing configuration of other images:
824+
# set(<image>_<var> <value> CACHE INTERNAL "<description>")
825+
826+
# Finds the sysbuild project and includes it with the new configuration
827+
find_package(Sysbuild REQUIRED HINTS $ENV{ZEPHYR_BASE})
828+
829+
project(sysbuild LANGUAGES)
830+
831+
An example of adding a ``BOARD_ROOT``:
832+
833+
.. code-block:: cmake
834+
835+
list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../<extra-board-root>)
836+
837+
find_package(Sysbuild REQUIRED HINTS $ENV{ZEPHYR_BASE})
838+
839+
project(sysbuild LANGUAGES)
840+
841+
This will pass the board root on to all images as part of a project, it does not need to be
842+
repeated in each image's ``CMakeLists.txt`` file.
843+
804844
Extending sysbuild
805845
******************
806846

doc/develop/application/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,11 @@ boilerplate with ``find_package(Zephyr ...)``.
11971197
When using ``-DBOARD_ROOT=<board-root>`` both absolute and relative paths can
11981198
be used. Relative paths are treated relatively to the application directory.
11991199

1200+
.. note::
1201+
1202+
When using sysbuild, then ``BOARD_ROOT`` must defined in a module or in the sysbuild
1203+
``CMakeLists.txt`` file, see :ref:`sysbuild_var_override` for details.
1204+
12001205
SOC Definitions
12011206
===============
12021207

0 commit comments

Comments
 (0)