Configuring my custom board throws errors

I created a custom board and tried experimenting by changing the following:

prj.conf

CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_SERIAL=y
CONFIG_GPIO=y
CONFIG_PWM=y

# Make sure printk is not printing to the UART console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

CONFIG_HEAP_MEM_POOL_SIZE=2048
CONFIG_MAIN_THREAD_PRIORITY=7

CONFIG_ZIGBEE=y
CONFIG_ZIGBEE_APP_UTILS=y
CONFIG_ZIGBEE_ROLE_ROUTER=y

# Enable DK LED and Buttons library
CONFIG_DK_LIBRARY=y

# This example requires more workqueue stack
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Enable nRF ECB driver
CONFIG_CRYPTO=y
CONFIG_CRYPTO_NRF_ECB=y
CONFIG_CRYPTO_INIT_PRIORITY=80

# Networking
CONFIG_NET_IPV6=n
CONFIG_NET_IP_ADDR_CHECK=n
CONFIG_NET_UDP=n

# Scene extension
CONFIG_ZIGBEE_SCENES=y

customboard_defconf

# Enable MPU
CONFIG_ARM_MPU=y

# Enable hardware stack protection
CONFIG_HW_STACK_PROTECTION=y

# Enable RTT
CONFIG_USE_SEGGER_RTT=y

# enable GPIO
CONFIG_GPIO=y

# enable uart driver
CONFIG_SERIAL=y

# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

CONFIG_PINCTRL=y

Now when trying to build again I get:

 *  Executing task: nRF Connect: Build [pristine]: testproject/build (active) 

Building template
west build --build-dir /NordicTests/testproject/build /home/user/ncs/v2.9.0/zephyr/share/sysbuild/template --pristine --board ZanaBoard_Valve/nrf52833 -- -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=/NordicTests/testproject

-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: /home/user/ncs/toolchains/b77d8c1312/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
-- Cache files will be written to: /home/user/.cache/zephyr
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: ZanaBoard_Valve, qualifiers: nrf52833
Parsing /home/user/ncs/v2.9.0/zephyr/share/sysbuild/Kconfig
Loaded configuration '/NordicTests/testproject/build/_sysbuild/empty.conf'
Merged configuration '/NordicTests/testproject/build/_sysbuild/empty.conf'
Configuration saved to '/NordicTests/testproject/build/zephyr/.config'
Kconfig header saved to '/NordicTests/testproject/build/_sysbuild/autoconf.h'
-- 
   ******************************
   * Running CMake for template *
   ******************************

Loading Zephyr module(s) (Zephyr base): sysbuild_default
CMake Warning (dev) at /home/user/ncs/v2.9.0/zephyr/cmake/modules/FindDeprecated.cmake:40 (if):
  Policy CMP0057 is not set: Support new IN_LIST if() operator.  Run "cmake
  --help-policy CMP0057" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  IN_LIST will be interpreted as an operator when the policy is set to NEW.
  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  /home/user/ncs/v2.9.0/zephyr/cmake/modules/python.cmake:16 (find_package)
  /home/user/ncs/v2.9.0/zephyr/cmake/modules/user_cache.cmake:30 (include)
  /home/user/ncs/v2.9.0/zephyr/cmake/modules/extensions.cmake:5 (include)
  /home/user/ncs/v2.9.0/zephyr/share/sysbuild/cmake/modules/sysbuild_default.cmake:8 (include)
  /home/user/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
  /home/user/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  /home/user/ncs/v2.9.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
  CMakeLists.txt:10 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /home/user/ncs/v2.9.0/zephyr/cmake/modules/FindDeprecated.cmake:40 (if):
  if given arguments:

    "CROSS_COMPILE" "IN_LIST" "Deprecated_FIND_COMPONENTS"

  Unknown arguments specified
Call Stack (most recent call first):
  /home/user/ncs/v2.9.0/zephyr/cmake/modules/python.cmake:16 (find_package)
  /home/user/ncs/v2.9.0/zephyr/cmake/modules/user_cache.cmake:30 (include)
  /home/user/ncs/v2.9.0/zephyr/cmake/modules/extensions.cmake:5 (include)
  /home/user/ncs/v2.9.0/zephyr/share/sysbuild/cmake/modules/sysbuild_default.cmake:8 (include)
  /home/user/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
  /home/user/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  /home/user/ncs/v2.9.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
  CMakeLists.txt:10 (find_package)


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.21)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
  CMake configure failed for Zephyr project: template

  Location: /home/user/ncs/v2.9.0/zephyr/share/sysbuild/template
Call Stack (most recent call first):
  cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)
  cmake/modules/sysbuild_default.cmake:20 (include)
  /home/user/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
  /home/user/ncs/v2.9.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  /home/user/ncs/v2.9.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
  template/CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!
See also "/NordicTests/testproject/build/CMakeFiles/CMakeOutput.log".
FATAL ERROR: command exited with status 1: /home/user/ncs/toolchains/b77d8c1312/usr/local/bin/cmake -DWEST_PYTHON=/home/user/ncs/toolchains/b77d8c1312/usr/local/bin/python3.12 -B/NordicTests/testproject/build -GNinja -DBOARD=ZanaBoard_Valve/nrf52833 -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=/NordicTests/testproject -S/home/user/ncs/v2.9.0/zephyr/share/sysbuild -DAPP_DIR:PATH=/home/user/ncs/v2.9.0/zephyr/share/sysbuild/template

 *  The terminal process terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it.

Parents
  • Hello,

    I apologize for the frustrations. I have another customer with a similar issue and it came down to a missing a CMakeLists.txt file in the custom board directory and a KConfig value <board>_INIT_PRIORITY in the prj.conf file. Are you able to check that your custom board directory contains this CMakeLists.txt file and prj.conf has the required KConfig for the project to be able to compile in your board.c?

  • We do not have these. The board was created with the VSCode tools on nrf Connect v2.6 and has been working fine for months until upgrading to v2.9 (from v2.7). Are these a new requirement? We didn't see any mention of them in the migration guides for v2.8 or v2.9.

  • As if nRF Connect SDK v2.7 we adopted Zephyr's v2 Hardware Model as noted in this link: https://docs.nordicsemi.com/bundle/nrf-connect-vscode/page/guides/bd_work_with_boards.html#how-to-add-a-new-board

    You can then get more information on porting your board to this new Hardware model via the link in the picture above: Board Porting Guide

    Here you will find all the information about the new model including the file structure for the board file and how to convert your board files from v2.6 to the new format. 

    I believe we may have accepted the old model up through v2.8 but started enforcing it in v2.9. I also have not found reference to this yet in the migration guide but will be sure to provide this feedback to the teams. 

  • Ah yes, I do remember this when moving to v2.7. We used the conversion script and have been running v2.7 for many months successfully on hundreds of pieces of hardware. We've also been running v2.9 for a month or so on dozens of hardware as well. The issue is just coming up when trying to edit the configuration and memory layout for the product

    Did the Zephyr provided conversions script not actually migrate this correctly? I see no mention of a CMakeLists file nor a *INIT_PRIORITY* macro in the script.

    The CMakeLists is listed as optional in the documentation you linked and <board>_INIT_PRIORITY is not mentioned at all.

  • As I mentioned, it is in the Board Porting guide but you have to really read between the lines and then verify that the result from the script is what is required. The following is listed in the 'Create your board directory section':

    Basically, there may be things outside the script that are needed and the only way to know would be to read through all the sections carefully :) ...which sucks for us engineers but is a necessary evil.

  • Yes I've read that. My project does not check any of the boxes where a CMakeLists.txt is necessary in board folder. And I am still yet to find any documentation about a <board_name>INIT_PRIORITY macro anywhere on the internet.

    Regardless, I've got around the root issue of this by just starting over on my changes and somehow avoiding getting into the state.

    I don't think this changes the fact that this is a bug in the CMake files provided by Zephyr/Nordic. The reported CMake error is a syntax/usage error and those files trigger multiple CMake developer warnings that should be resolved by Zephyr/Nordic. A user config error should not be able to cause this type of error and ultimately this is masking the cause of the actual error and not helpful in resolving it.

  • If you are getting the exact same error as originally reported then there is an issue with the CMakeLists.txt file and you need to add the following at the top, as stated in the error message:

    cmake_minimum_required(VERSION 3.21)

    If, as you mentioned, this line absolutely exists then the error message you are receiving when building some other application is not the same as the one originally posted. If you attempt to build a sample application using your custom board as the target, what is the build output?

    I cannot concur that it is a syntax/usage error without seeing the error you are experiencing and it can't be the same as the original one above if your CMakeLists.txt file really matches my earlier message.

Reply
  • If you are getting the exact same error as originally reported then there is an issue with the CMakeLists.txt file and you need to add the following at the top, as stated in the error message:

    cmake_minimum_required(VERSION 3.21)

    If, as you mentioned, this line absolutely exists then the error message you are receiving when building some other application is not the same as the one originally posted. If you attempt to build a sample application using your custom board as the target, what is the build output?

    I cannot concur that it is a syntax/usage error without seeing the error you are experiencing and it can't be the same as the original one above if your CMakeLists.txt file really matches my earlier message.

Children
No Data
Related