Unable to find out-of-tree board definitions with SDK-0.15.0->sysbuild

I’ve been unable to find my out-of-tree board definitions to Golioth firmware SDK 0.15.0. It will work on the command line but sysbuild fails before reading any of the config files.
–start with reference design template_v2.4.1
–copy aldul_mini in-tree board definition to aldul-mini2 in ./app/board/vendor and patch up all references
–It builds properly with “west build -p -b aludel_mini2/nrf9160/ns --sysbuild app – -DBOARD_ROOT=.” so the board file is good.

jstuewe@Inspiron-3910:~/prj/golioth15$ west build -p -b aludel_mini2/nrf9160/ns --sysbuild app – -DBOARD_ROOT=.
– west build: making build dir /home/jstuewe/prj/golioth15/build pristine
– west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
– Found Python3: /usr/bin/python3 (found suitable version “3.10.12”, minimum required is “3.8”) found components: Interpreter
– Cache files will be written to: /home/jstuewe/.cache/zephyr
– Found west (found suitable version “1.2.0”, minimum required is “0.14.0”)
– Board: aludel_mini2, qualifiers: nrf9160/ns
Parsing /home/jstuewe/prj/golioth15/deps/zephyr/share/sysbuild/Kconfig
Loaded configuration ‘/home/jstuewe/prj/golioth15/build/_sysbuild/empty.conf’
Merged configuration ‘/home/jstuewe/prj/golioth15/app/sysbuild.conf’
Configuration saved to ‘/home/jstuewe/prj/golioth15/build/zephyr/.config’
Kconfig header saved to ‘/home/jstuewe/prj/golioth15/build/_sysbuild/autoconf.h’
’ *****************************
’ * Running CMake for mcuboot *
’ *****************************
Loading Zephyr default modules (Zephyr base).
– Application: /home/jstuewe/prj/golioth15/deps/bootloader/mcuboot/boot/zephyr
{… Successful compile}

I’ve tried a dozen ways to set BOARD_ROOT in config files but it appears that sysbuild fails to find the board before reading any of them.

sysbuild has three sections, the initial load, CMake for mcuboot, and CMake for app. The documented method to add BOARD_ROOT using CMakelists.cfg is only valid for the last run, which it never gets to so there has to be a different way to set it.

As you can see below it fails to find the board before it even reads sysbuild.conf, much less CMakelists.txt

jstuewe@Inspiron-3910:~/prj/golioth15$ west build -p -b aludel_mini2/nrf9160/ns --sysbuild app
– west build: making build dir /home/jstuewe/prj/golioth15/build pristine
– west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
– Found Python3: /usr/bin/python3 (found suitable version “3.10.12”, minimum required is “3.8”) found components: Interpreter
– Cache files will be written to: /home/jstuewe/.cache/zephyr
– Found west (found suitable version “1.2.0”, minimum required is “0.14.0”)
No board named ‘aludel_mini2’ found.

What is the method to set custom board paths when using 0.15.0 which moved over to sysbuild? All previous articles and blogs are out of date and don’t work.

Hey John, acknowledging your report. We’ll take a look at this and get back to you with any questions or guidance soon.

Hey @john.stuewe,

Sysbuild was introduced in SDK v0.15.0 because NCS 2.7.0 added support for it. We adopted it to ensure compatibility between NCS and Zephyr.

In addition, with SDK v0.15.0, we had to migrate to hardware model v2, which was introduced in Zephyr v3.7. We followed this board porting guide to migrate the Aludel Mini/Elixir boards.

The issues you’re encountering are unrelated to the Golioth Firmware SDK and are somewhat difficult to track.

I suspect you may need a file like this to define the board_root. We’ve also pushed a branch to the Reference Design Template that avoids using golioth-zephyr-boards as a module for you to review.

Additionally, from the Zephyr documentation, Custom Board, Devicetree, and SOC Definitions, there’s a statement that might be useful:

When specifying BOARD_ROOT in a CMakeLists.txt, then an absolute path must be provided, for example list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/<extra-board-root>). When using -DBOARD_ROOT=<board-root> both absolute and relative paths can be used. Relative paths are treated relatively to the application directory.

@john.stuewe, we think you are hitting this problem.

The behavior documented there explains why you couldn’t get this working with a simple addition to CMakeLists.txt. It was the wrong CMakeLists ; it is needed to specify one in the sysbuild subdirectory as shown in this response.

We think the way we did it in RD template branch is not bad, but it does seem to abuse the Zephyr module setup.

Thanks Marko,
That got it to work.

my ./sysbuild/CMakeLists.txt file now includes:

cmake_minimum_required(VERSION 3.20.0)

get_filename_component(CURRENT_DIR ${CMAKE_CURRENT_LIST_DIR} ABSOLUTE)
get_filename_component(PARENT_DIR ${CURRENT_DIR} DIRECTORY)
get_filename_component(APP_NAME ${PARENT_DIR} NAME)

list(APPEND BOARD_ROOT ${PARENT_DIR})

message(“-- sysbuild BOARD_ROOT ‘${BOARD_ROOT}’” )

find_package(Sysbuild REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(${APP_NAME} LANGUAGES)