Unable to build for custom board, c compiler not found

Hello everyone,

So I'm trying to build for a custom nRF9160 board. I've copied the Thingy:91 board and renamed all files and edited the cmake , as per the guide and video.

I am working in ncs 2.0.0, using vscode, in win11.

When trying to build for this new board, I get the following error:

CMake Error at C:/ncs/v2.0.0/zephyr/cmake/compiler/gcc/target.cmake:10 (message):
  C compiler C:/ncs/toolchains/v2.0.0/opt/zephyr-sdk//bin/-gcc not found -
  Please check your toolchain installation
Call Stack (most recent call first):
  C:/ncs/v2.0.0/zephyr/cmake/modules/target_toolchain.cmake:63 (include)
  C:/ncs/v2.0.0/zephyr/cmake/modules/zephyr_default.cmake:121 (include)
  C:/ncs/v2.0.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:51 (include)
  C:/ncs/v2.0.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:76 (include_boilerplate)
  CMakeLists.txt:11 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: 'c:\ncs\toolchains\v2.0.0\opt\bin\cmake.EXE' '-DWEST_PYTHON=c:\ncs\toolchains\v2.0.0\opt\bin\python.exe'

Building for other targets, like thingy and dk, works just fine. The error code comes from the following lines in target.cmake:

find_program(CMAKE_C_COMPILER ${CROSS_COMPILE}${CC} PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
if(${CMAKE_C_COMPILER} STREQUAL CMAKE_C_COMPILER-NOTFOUND)
  message(FATAL_ERROR "C compiler ${CROSS_COMPILE}${CC} not found - Please check your toolchain installation")
endif()

Does anyone have suggestions as how to fix this? Is there something I've missed?

Thank you all for all and any suggestions!

  • Hello Raoul,

    And thank you for looking into this issue.

    After returning to office after the holidays, it has somehow resolved it self. I am now able to build for custom boards made with both the wizard and "manually", in both SDK2.0.0 and 2.2.0, and with both "Hello world" and our custom application.

    I have not made any changes to the toolchain or other installations. I don't know what caused the issue or how it got fixed. I will make sure to post again if I get a similar problem in the future. 

    I will close this case. Thanks again.

    Kind regards,

    Torje

Related