How to use CMakePresets with west and sysbuild in NCS v2.7.0?

I was following instructions from this and this post, but I'm not yet able to build with the following combination: CMakePresets.json + west + sysbuild.

I'm using this west command in a nRF Connect command line on v2.7.0:

west build -d ${targetDir} -- --preset ${presetName}

I understood from one of the posts it can't be forced to use sysbuild, but assumed that it would then behave similarly as the option "Build system default" in the vscode extension. However when using west with the preset it just doesn't use sysbuild, but uses the old parent/child approach.

Do you have any tips to get this to work with sysbuild?

Thanks,

Koos

Parents
  • Hi, 

    I'm using this west command in a nRF Connect command line on v2.7.0:

    west build -d ${targetDir} -- --preset ${presetName}

    Add "--sysbuild" into your command as

    west build -d ${targetDir} --sysbuild -- --preset ${presetName}

    See Building with sysbuild documentation.

    Regards,
    Amanda H.

  • Hi Amanda,

    Forgot to mention, but I already tried that, it gives me the following error:

    WARNING: This looks like a fresh build and BOARD is unknown; so it probably won't work. To fix, use --board=<your-board>.
    Note: to silence the above message, run 'west config build.board_warn false'
    -- west build: generating a build system
    CMake Error: Could not read presets from /opt/nordic/ncs/v2.7.0/zephyr/share/sysbuild:
    File not found: /opt/nordic/ncs/v2.7.0/zephyr/share/sysbuild/CMakePresets.json
    FATAL ERROR: command exited with status 1: /opt/homebrew/bin/cmake -DWEST_PYTHON=/opt/nordic/ncs/toolchains/f8037e9b83/opt/[email protected]/bin/python3.9 -B/Users/koos/Documents/projects/***/***_fw/app/build_release_test -GNinja --preset build_***_release -S/opt/nordic/ncs/v2.7.0/zephyr/share/sysbuild -DAPP_DIR:PATH=/Users/koos/Documents/projects/***/***_fw/app

    How did you get that command to work?

    Kind regards,

    Koos

  • Add "-b <board_name>" to the command. 

    What board are you using? If you are using nRF52840DK, the command would be

    west build -b nrf52840dk_nrf52840 -d ${targetDir} --sysbuild -- --preset ${presetName}

  • Oh that's indeed confusing, but that's not the issue, it's just a warning somehow, cause it does actually detect the board (when it uses the parent/child method). 

    So if I add the "-b <board_name>" command, that first warning goes away, but the CMake error is still the same.

  • I double checked and it can be reproduced by following these steps:

    1. open the hello_world sample
    2. add a build configuration using the vscode extension and leave everything at default settings
    3. use the "Save Configuration as Preset" option
    4. build it with west build --board=nrf52840dk/nrf52840 -- --preset build
    5. the build fails
Reply Children
Related