CMakePresets.json: how to select board/target and enable sysbuild

We're been making use of CMakePresets.json and the "Pre-fill from preset" feature in the VS Code nRF Connect extension "Add Build Configuration" workflow with an earlier SDK (2.6.0). We've now updated to SDK 2.7.0 and extension version 2024.12.55 and also updated our custom out-of-tree board to hwmv2. The code builds fine when I create my build configuration manually, so now it's time to circle back and update the CMakePresets.json to use the hwmv2 board name and sysbuild.

I've indicated the board plank/nrf5340/cpuapp/ns in the BOARD variable just as we did with the hwmv1 board name. The trouble is this: when I load the preset that board value doesn't get placed into the "Board target" field in the "Add Build Configuration" GUI. Is there a different way of setting the board in the CMakePresets now?

The secondary request is this: is there a way for my CMakePresets to change the "System build (sysbuild)" selection from its default ("Build system default") to "Use sysbuild"? I know I could change the SDK global default setting on the command line but I'd prefer to see the CMakePresets flow capture and apply this setting.

My CMakePresets.json file is below.

{
    "version": 2,
    "cmakeMinimumRequired": {
        "major": 3,
        "minor": 20
    },
    "configurePresets": [
        {
            "name": "Base build",
            "displayName": "standard configuration",
            "generator": "Ninja",
            "binaryDir": "${sourceDir}/build",
            "cacheVariables": {
                "NCS_TOOLCHAIN_VERSION": "NONE",
                "BOARD": "plank/nrf5340/cpuapp/ns",
                "CONF_FILE": "prj.conf",
                "EXTRA_CONF_FILE": "overlay-lpuart.conf;overlay-azure.conf",
                "DTC_OVERLAY_FILE": "dts.overlay;dts-nfc.overlay"
            }
        }
    ]
}

Related