This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Zephyr unable to find toolchain issue

Hey all

I've had some issues with the zephyr installation and have followed the steps for setting up the toolchain.

When im building a project from the command prompt it fails with the log 


C:\ncs\v1.7.0\zephyr>west build -b nrf5340dk_nrf5340_cpuapp tests/lib/gui/lvgl -- -DSHIELD=ssd1306_128x64
WARNING: ZEPHYR_BASE=C:\zephyrproject\zephyr in the calling environment will be used,
but the zephyr.base config option in C:\ncs\v1.7.0 is "zephyr"
which implies a different ZEPHYR_BASE=C:\ncs\v1.7.0\zephyr
To disable this warning in the future, execute 'west config --global zephyr.base-prefer env'
-- west build: generating a build system
Including boilerplate (Zephyr base (cached)): C:/zephyrproject/zephyr/cmake/app/boilerplate.cmake
-- Application: C:/ncs/v1.7.0/zephyr/tests/lib/gui/lvgl
-- Zephyr version: 2.7.99 (C:/zephyrproject/zephyr), build: v2.7.0-rc3-275-gef0d955758e5
-- Found west (found suitable version "0.11.1", minimum required is "0.7.1")
-- Board: nrf5340dk_nrf5340_cpuapp, Shield(s): ssd1306_128x64
-- Cache files will be written to: C:/zephyrproject/zephyr/.cache
-- Found dtc: C:/ProgramData/chocolatey/bin/dtc.exe (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (C:/gnuarmemb/bin)
CMake Error at C:/zephyrproject/zephyr/cmake/compiler/gcc/generic.cmake:9 (message):
  Zephyr was unable to find the toolchain.  Is the environment misconfigured?

  User-configuration:

  ZEPHYR_TOOLCHAIN_VARIANT: gnuarmemb

  Internal variables:

  CROSS_COMPILE: C:/gnuarmemb/bin/bin/arm-none-eabi-

  TOOLCHAIN_HOME: C:/gnuarmemb/bin

Call Stack (most recent call first):
  C:/zephyrproject/zephyr/cmake/generic_toolchain.cmake:42 (include)
  C:/zephyrproject/zephyr/cmake/app/boilerplate.cmake:540 (include)
  C:/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  C:/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
  CMakeLists.txt:4 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' '-DWEST_PYTHON=c:\users\andre\appdata\local\programs\python\python39\python.exe' '-BC:\ncs\v1.7.0\zephyr\build' '-SC:\ncs\v1.7.0\zephyr\tests\lib\gui\lvgl' -GNinja -DSHIELD=ssd1306_128x64

C:\ncs\v1.7.0\zephyr>


I dont have any issue building from the nrf connect
My path settings are below

the things that feel off for me would ieither be the zephyr base not being in my ncs folder or the opposite the instructions give me an impression i should be directing to the zephyrproject folder as opposed to the ncs one.

also the cross compile variable path from the cmd log is : C:/gnuarmemb/bin/bin/arm-none-eabi- which looks off

any clues ?

  • Hi,

    When you install the nRF Connect SDK using the Toolchain Manager, and you want to build on the command prompt, we recommend opening it using the command script "git-cmd" found at <NCS_INSTALL_FOLDER>/toolchain/. This will correctly set up the environment variables and open the command prompt.

    In the Toolchain Manager, each installation has a dropdown menu with a button labeled "Open command prompt", which runs this script.

    If you would like to use another command-line shell, you can try running the "env" command script from the command line. The "env" script is located at <NCS_INSTALL_FOLDER>/toolchain/cmd/.

  • Oh ok, il give that a try shortly and update you. thanks again !

  • Thanks ! sorry for the late reply. also adding in -p to clean it helps as well.

Related