Getting started with blinky doesn't work

I followed all the steps from the website:
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/develop/getting_started/index.html

But I get the following error message:

~/zephyrproject/zephyr$ west build -p always -b nrf52840dk_nrf52840 samples/basic/blinky
-- west build: making build dir /home/ephimee/zephyrproject/zephyr/build pristine
-- west build: generating a build system
Including boilerplate (Zephyr base): /home/ephimee/zephyrproject/zephyr/cmake/app/boilerplate.cmake
CMake Deprecation Warning at /home/ephimee/zephyrproject/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
The OLD behavior for policy CMP0079 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
/home/ephimee/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
/home/ephimee/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
CMakeLists.txt:4 (find_package)


-- Application: /home/ephimee/zephyrproject/zephyr/samples/basic/blinky
-- Zephyr version: 2.4.99 (/home/ephimee/zephyrproject/zephyr)
-- Found Python3: /usr/bin/python3.8 (found suitable exact version "3.8.10") found components: Interpreter
-- Found west (found suitable version "0.13.1", minimum required is "0.7.1")
-- Board: nrf52840dk_nrf52840
-- Cache files will be written to: /home/ephimee/.cache/zephyr
-- Found toolchain: zephyr (/home/ephimee/ncs_v2.0.2/toolchains/v2.0.2/opt/zephyr-sdk)
-- Found dtc: /usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/ephimee/zephyrproject/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
CMake Error at /home/ephimee/zephyrproject/zephyr/cmake/extensions.cmake:1585 (file):
file failed to open for reading (No such file or directory):

/home/ephimee/zephyrproject/zephyr/build/zephyr/nrf52840dk_nrf52840.dts.pre.d
Call Stack (most recent call first):
/home/ephimee/zephyrproject/zephyr/cmake/dts.cmake:162 (toolchain_parse_make_rule)
/home/ephimee/zephyrproject/zephyr/cmake/app/boilerplate.cmake:506 (include)
/home/ephimee/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
/home/ephimee/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
CMakeLists.txt:4 (find_package)


FATAL ERROR: Couldn't open "nrf52840dk_nrf52840.dts.pre.tmp": No such file or directory
CMake Error at /home/ephimee/zephyrproject/zephyr/cmake/dts.cmake:205 (message):
command failed with return code: 1
Call Stack (most recent call first):
/home/ephimee/zephyrproject/zephyr/cmake/app/boilerplate.cmake:506 (include)
/home/ephimee/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
/home/ephimee/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
CMakeLists.txt:4 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /home/ephimee/.local/bin/cmake -DWEST_PYTHON=/usr/bin/python3 -B/home/ephimee/zephyrproject/zephyr/build -S/home/ephimee/zephyrproject/zephyr/samples/basic/blinky -GNinja -DBOARD=nrf52840dk_nrf52840

Parents
  • Hello,

    I have started to look at this, but was not able to reproduce the error on a Windows device. It seems you are using a Linux device, so I will try to reproduce the issue on a Linux device as well.

    In the meantime, you can help by providing some additonal information about your setup:

    1. What OS and which version of it are you using?

    2. Is there a particular reason you are using Zephyr project and not nRF Connect SDK?

    Kind Regards,
    Maria

  • I'm on Ubuntu 20.04.5 LTS.

    According to the Nordic website, they use this Zephyr project example. So if this is incorrect, the website needs to be updated.

  • I am continuing to study the build log you have provided.

    -- Zephyr version: 2.4.99 (/home/ephimee/zephyrproject/zephyr)

    This version of Zephyr was tagged over two years ago. The newest tagged release is v3.2.0. The two versions of the Zephyr project uses different toolchains. If your SDK version and your toolchain version does not match, this could be the cause of your error.

    -- Found toolchain: zephyr (/home/ephimee/ncs_v2.0.2/toolchains/v2.0.2/opt/zephyr-sdk)

    Zephyr Project v3.0.99 is used with NCS v2.0.2. The toolchain version is zephyr-sdk-0.14.1.

    Since you are using Zephyr Project, I am not sure why you have a folder referring to NCS. Have you got a previous install of NCS on your computer? This could be the reason for any version incompatibilities.

    Regards,
    Maria

  • Yes, you are right. I'm using NCS 1.6.1 with Nordic Segger.

    Because NCS 1.6.1 will be phased out in the future, I'm already preparing for NCS 2.x

    So basically I want to run both versions because I want to develop new things on NCS 2x while maintaining the older versions on NCS 1.6.1

    Is there a way to setup the environment for a specific NCS version? So I can go back and forth?

  • Hello,

    ephimee said:
    Yes, you are right. I'm using NCS 1.6.1 with Nordic Segger.

    Aha, the mismatch makes sense then.

    ephimee said:
    Is there a way to setup the environment for a specific NCS version? So I can go back and forth?

    It is possible to have several instances of NCS installed. But you need to make sure that all the environment variables are set to the version you are using for each session.

    Note that you do not have NCS v2.0.2 installed by following the guide you linked in your original ticket. To install NCS v2.0.2, follow this guide.

    I do not know how SEGGER Embedded Studio (SES) sets up the building environment and if it is compatible with another version of NCS being installed. Let me know if you want to continue to use SES for NCS v1.6.1 and I can find out what to consider when having multiple versions of NCS installed.

    A configuration that should work is to build from the command line. To use switch between the versions you can run the zephyr-env.sh script before building with the version you choose. Instructions are found here. The script is within <ncs-installation>/zephyr.

    I have not tested this configuration yet, but I can do so after the weekend.

    An extra bit of information about NCS v1.6.1 and v2.0.2 is that they use different toolchains. v1.6.1 uses GNU Arm Embedded toolchain, while v2.0.2 uses Zephyr SDK toolchain. The switch was made with the release of NCS 2.0.0.

    BR,
    Maria

  • It is possible to have several instances of NCS installed. But you need to make sure that all the environment variables are set to the version you are using for each session.

    Can you tell me which environment settings I need to set including value?

    I do not know how SEGGER Embedded Studio (SES) sets up the building environment and if it is compatible with another version of NCS being installed. Let me know if you want to continue to use SES for NCS v1.6.1 and I can find out what to consider when having multiple versions of NCS installed.

    It's a long time ago I installed SES with NCS 1.6.1, but I use it daily and is necessary to support the code base until we've completely moved to NCS2 so yes I still need it.

    A configuration that should work is to build from the command line. To use switch between the versions you can run the zephyr-env.sh script before building with the version you choose. Instructions are found here. The script is within <ncs-installation>/zephyr.

    I ran the script zephyr/zephyr-env.sh before west build, and it compiles. And with west flash I was able to load it onto the DK board.

  • Hello,

    Sorry for the delay. I had a few days off.

    ephimee said:
    Can you tell me which environment settings I need to set including value?

    The following is the case for setting up the environment variables for building with the command line.

    In both versions of NCS you need ZEPHYR_BASE=<path to ncs-version>.

    For NCS v1.6.1, you need

    ZEPHYR_TOOLCHAIN_VARIANT="gnuarmemb"
    GNUARMEMB_TOOLCHAIN_PATH=<path to installation of toolchain>

    For NCS v2.0.2 you need

    ZEPHYR_TOOLCHAIN_VARIANT="zephyr"

    You can either set these variables when switching between the versions, or make a script for setting them for ease of use.

    use export <VARIABLE_NAME>=value to set the variables.

    ephimee said:
    It's a long time ago I installed SES with NCS 1.6.1, but I use it daily and is necessary to support the code base until we've completely moved to NCS2 so yes I still need it.

    Ok, thank you for clarifying. Setting up the environment variables in SES is done by following the instructions here.

    Starting with NCS v2.0.0 SES is no longer supported as an IDE. The recommended IDE for NCS v2.x.y is VS Code and using the nRF Connect for VS Code Extension.

    ephimee said:
    I ran the script zephyr/zephyr-env.sh before west build, and it compiles. And with west flash I was able to load it onto the DK board.

    Ok, good that you were able to build and flash. When building, make sure to pay attention to the toolchain variant and the Zephyr version when building. When building with NCS v1.6.1, the Zephyr version should be 2.6.0-rc1 and the toolchain found should be gnuarmemb. When building with NCS v2.0.2, the Zephyr version should be 3.0.99 and the toolchain found should be zephyr 0.14.1.

    Kind Regards,
    Maria

Reply
  • Hello,

    Sorry for the delay. I had a few days off.

    ephimee said:
    Can you tell me which environment settings I need to set including value?

    The following is the case for setting up the environment variables for building with the command line.

    In both versions of NCS you need ZEPHYR_BASE=<path to ncs-version>.

    For NCS v1.6.1, you need

    ZEPHYR_TOOLCHAIN_VARIANT="gnuarmemb"
    GNUARMEMB_TOOLCHAIN_PATH=<path to installation of toolchain>

    For NCS v2.0.2 you need

    ZEPHYR_TOOLCHAIN_VARIANT="zephyr"

    You can either set these variables when switching between the versions, or make a script for setting them for ease of use.

    use export <VARIABLE_NAME>=value to set the variables.

    ephimee said:
    It's a long time ago I installed SES with NCS 1.6.1, but I use it daily and is necessary to support the code base until we've completely moved to NCS2 so yes I still need it.

    Ok, thank you for clarifying. Setting up the environment variables in SES is done by following the instructions here.

    Starting with NCS v2.0.0 SES is no longer supported as an IDE. The recommended IDE for NCS v2.x.y is VS Code and using the nRF Connect for VS Code Extension.

    ephimee said:
    I ran the script zephyr/zephyr-env.sh before west build, and it compiles. And with west flash I was able to load it onto the DK board.

    Ok, good that you were able to build and flash. When building, make sure to pay attention to the toolchain variant and the Zephyr version when building. When building with NCS v1.6.1, the Zephyr version should be 2.6.0-rc1 and the toolchain found should be gnuarmemb. When building with NCS v2.0.2, the Zephyr version should be 3.0.99 and the toolchain found should be zephyr 0.14.1.

    Kind Regards,
    Maria

Children
Related