The BOARD variable is not defined at the top of CmakeLists.txt on ncs2.8.0

I work test program on ncs2.8.0.

I put a reference to the BOARD variable at the top of my project's CMakeLists.txt.

When "west build -b nrf52833dk_nrf52833",  BOARD is not defined.

But,

When "cmake -GNinja -DBOARD=nrf52833dk_nrf52833 ..",  BOARD is nrf52833dk_nrf52833.

This was not a problem in ncs2.6.0.
Please tell me how to reference the BOARD in ncs2.8.0.

Parents Reply
  • Hi,

    You can do this in the file sysbuild.cmake when using sysbuild. If you do not have this file in your project already, create it. If you want to add, for example, prj_release.conf when building for nRF52833 DK, add the following to sysbuild.cmake:

    if(SB_CONFIG_BOARD_NRF52833DK_NRF52833)
        set(${DEFAULT_IMAGE}_CONF_FILE "prj_release.conf" CACHE INTERNAL "")
    endif()

    Best regards,
    Marte

Children
Related