Help with error: cmake:2891 (message):BOARD is not being defined on the CMake command-line,

Hi, 

I am getting the following error:
CMake Error at C:/ncs/v2.6.1/zephyr/cmake/modules/extensions.cmake:2891 (message):BOARD is not being defined on the CMake command-line, in the environment or
by the app.

I have explicitly added "set(board nrf5340dk_nrf5340)" to the cmake file in an attempt to fix it, but to no avail.
//---------------------------------------- cmake.txt ---------------------------------------------------------------- 

# SPDX-License-Identifier: Apache-2.0


cmake_minimum_required(VERSION 3.20.0)
set(board nrf5340dk_nrf5340)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(blinky_pwm)

target_sources(app PRIVATE src/main.c)
//---------------------------------------- cmake.txt ---------------------------------------------------------------- 
I have even tried adding the path to the overlay file in the build config using "-DBOARD="c/...."   
//--------------------------------------- cmake debug detail ----------------------------------------------------------------
Detailed cmake error is:
Exception has occurred: FATAL_ERROR
CMake Error at C:/ncs/v2.6.1/zephyr/cmake/modules/extensions.cmake:2891 (message): BOARD is not being defined on the CMake command-line, in the environment or by the app. Call Stack (most recent call first): C:/ncs/v2.6.1/zephyr/cmake/modules/boards.cmake:56 (zephyr_check_cache) C:/ncs/v2.6.1/zephyr/cmake/modules/zephyr_default.cmake:129 (include) C:/ncs/v2.6.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include) C:/ncs/v2.6.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate) CMakeLists.txt:5 (find_package)
//--------------------------------------- cmake debug detail ----------------------------------------------------------------
Please guide.
Thx!
Parents
  • Hello, 

    Looking at the documentation for "Working with the nRF53 series" there does seem to be a documentation bug, which states nrf5340dk_nrf5340 as build target. This is not correct. There are three build targets described under "Developing for nRF5340DK

    nRF5340 is a wireless ultra-low-power multicore System on Chip (SoC) with two fully programmable Arm Cortex-M33 processors: a network core and an application core.

    The build target for the network core in Zephyr is nrf5340dk_nrf5340_cpunet

    The build target for application core is

    • nrf5340dk_nrf5340_cpuapp for build targets with CMSE disabled.

    • nrf5340dk_nrf5340_cpuapp_ns for build targets that have CMSE enabled and have the SPE firmware alongside the NSPE firmware.

    Can you please use nrf5340dk_nrf5340_cpuapp instead i.e. set(board nrf5340dk_nrf5340_cpuapp)?

    Kind regards,
    Øyvind

Reply
  • Hello, 

    Looking at the documentation for "Working with the nRF53 series" there does seem to be a documentation bug, which states nrf5340dk_nrf5340 as build target. This is not correct. There are three build targets described under "Developing for nRF5340DK

    nRF5340 is a wireless ultra-low-power multicore System on Chip (SoC) with two fully programmable Arm Cortex-M33 processors: a network core and an application core.

    The build target for the network core in Zephyr is nrf5340dk_nrf5340_cpunet

    The build target for application core is

    • nrf5340dk_nrf5340_cpuapp for build targets with CMSE disabled.

    • nrf5340dk_nrf5340_cpuapp_ns for build targets that have CMSE enabled and have the SPE firmware alongside the NSPE firmware.

    Can you please use nrf5340dk_nrf5340_cpuapp instead i.e. set(board nrf5340dk_nrf5340_cpuapp)?

    Kind regards,
    Øyvind

Children
Related