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

nRF Connect for VS Code YouTube videos, having problems with Include paths and Kconfig in mac OS

 am following the introductory videos and have done a fresh install of the Toolchain, Segger, VS Connect 3.7.2, nRF Connect SDK v1.8.0 and VS code on macOS 

1. Installation

https://www.youtube.com/watch?v=2cv_jjqk5hg&list=PLx_tBuQ_KSqEt7NK-H7Lu78lT2OijwIMl

2. Create an application

https://www.youtube.com/watch?v=KwJtcPZHV30&list=PLx_tBuQ_KSqEt7NK-H7Lu78lT2OijwIMl&index=2

3. Building an application & Exploring windows

https://www.youtube.com/watch?v=3yi6kuxgdPg&list=PLx_tBuQ_KSqEt7NK-H7Lu78lT2OijwIMl&index=3

The source code shows errors with the paths for the INCLUDE statements:

This is the output from the Terminal window:

> Executing task: nRF Connect: Build blinky/build (active) <

Building blinky

west build --build-dir /Users/alwalker/workspace/blinky/build /Users/alwalker/workspace/blinky --pristine --board nrf5340dk_nrf5340_cpuapp -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DCONFIG_DEBUG_OPTIMIZATIONS:STRING="y" -DCONFIG_DEBUG_THREAD_INFO:STRING="y" -DCONF_FILE:STRING="/Users/alwalker/workspace/blinky/prj.conf"

-- west build: generating a build system

Including boilerplate (Zephyr base): /opt/nordic/ncs/v1.8.0/zephyr/cmake/app/boilerplate.cmake

-- Application: /Users/alwalker/workspace/blinky

-- Zephyr version: 2.7.0 (/opt/nordic/ncs/v1.8.0/zephyr), build: v2.7.0-ncs1

-- Found Python3: /opt/nordic/ncs/v1.8.0/toolchain/opt/[email protected]/bin/python3.9 (found suitable exact version "3.9.6") found components: Interpreter 

-- Found west (found suitable version "0.12.0", minimum required is "0.7.1")

-- Board: nrf5340dk_nrf5340_cpuapp

-- Cache files will be written to: /Users/alwalker/Library/Caches/zephyr

-- Found dtc: /opt/nordic/ncs/v1.8.0/toolchain/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")

-- Found toolchain: gnuarmemb (/opt/nordic/ncs/v1.8.0/toolchain)

-- Found BOARD.dts: /opt/nordic/ncs/v1.8.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts

-- Generated zephyr.dts: /Users/alwalker/workspace/blinky/build/zephyr/zephyr.dts

-- Generated devicetree_unfixed.h: /Users/alwalker/workspace/blinky/build/zephyr/include/generated/devicetree_unfixed.h

-- Generated device_extern.h: /Users/alwalker/workspace/blinky/build/zephyr/include/generated/device_extern.h

-- Including generated dts.cmake file: /Users/alwalker/workspace/blinky/build/zephyr/dts.cmake

Parsing /opt/nordic/ncs/v1.8.0/zephyr/Kconfig

/opt/nordic/ncs/v1.8.0/zephyr/scripts/kconfig/kconfig.py: /Users/alwalker/workspace/blinky/build/Kconfig/Kconfig.modules:38: Could not open '/opt/nordic/ncs/v1.8.0/zephyr/' (in 'osource "$(ZEPHYR_MCUBOOT_KCONFIG)"') (EISDIR: Is a directory)

CMake Error at /opt/nordic/ncs/v1.8.0/zephyr/cmake/kconfig.cmake:270 (message):

  command failed with return code: 1

Call Stack (most recent call first):

  /opt/nordic/ncs/v1.8.0/zephyr/cmake/app/boilerplate.cmake:546 (include)

  /opt/nordic/ncs/v1.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)

  /opt/nordic/ncs/v1.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)

  /Users/alwalker/workspace/blinky/build/CMakeLists.txt:4 (find_package)

-- Configuring incomplete, errors occurred!

FATAL ERROR: command exited with status 1: /opt/nordic/ncs/v1.8.0/toolchain/bin/cmake -DWEST_PYTHON=/opt/nordic/ncs/v1.8.0/toolchain/opt/[email protected]/bin/python3.9 -B/Users/alwalker/workspace/blinky/build -S/Users/alwalker/workspace/blinky -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DCONFIG_DEBUG_OPTIMIZATIONS:STRING=y -DCONFIG_DEBUG_THREAD_INFO:STRING=y -DCONF_FILE:STRING=/Users/alwalker/workspace/blinky/prj.conf

The terminal process terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

Using macOS Finder to locate the individual header files, Seem to have found the first one ok but not the others:

What should the paths be for the other header files please?

Note that in macOS the /opt folder is normally hidden.

When I do a Pristine Build, this is what is displayed in Terminal:

ound toolchain: gnuarmemb (/opt/nordic/ncs/v1.8.0/toolchain)
-- Found BOARD.dts: /opt/nordic/ncs/v1.8.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
-- Generated zephyr.dts: /Users/alwalker/workspace/blinky/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/alwalker/workspace/blinky/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /Users/alwalker/workspace/blinky/build/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: /Users/alwalker/workspace/blinky/build/zephyr/dts.cmake
Parsing /opt/nordic/ncs/v1.8.0/zephyr/Kconfig
/opt/nordic/ncs/v1.8.0/zephyr/scripts/kconfig/kconfig.py: /Users/alwalker/workspace/blinky/build/Kconfig/Kconfig.modules:38: Could not open '/opt/nordic/ncs/v1.8.0/zephyr/' (in 'osource "$(ZEPHYR_MCUBOOT_KCONFIG)"') (EISDIR: Is a directory)
CMake Error at /opt/nordic/ncs/v1.8.0/zephyr/cmake/kconfig.cmake:270 (message):
command failed with return code: 1
Call Stack (most recent call first):
/opt/nordic/ncs/v1.8.0/zephyr/cmake/app/boilerplate.cmake:546 (include)
/opt/nordic/ncs/v1.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
/opt/nordic/ncs/v1.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
/Users/alwalker/workspace/blinky/build/CMakeLists.txt:4 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /opt/nordic/ncs/v1.8.0/toolchain/bin/cmake -DWEST_PYTHON=/opt/nordic/ncs/v1.8.0/toolchain/opt/[email protected]/bin/python3.9 -B/Users/alwalker/workspace/blinky/build -S/Users/alwalker/workspace/blinky -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DCONFIG_DEBUG_OPTIMIZATIONS:STRING=y -DCONFIG_DEBUG_THREAD_INFO:STRING=y -DCONF_FILE:STRING=/Users/alwalker/workspace/blinky/prj.conf
The terminal process terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

There also doesn't look to be a Kconfig file selected, this is not mentioned in the three YouTube videos:

 

Any guidance is very welcome!

Parents
  • Hi,

    This should work out of the box. Can you try to build from the command line initially, to simplify things initially? Please open the toolchain manager, click the downwards error to the right of v1.8.0 and select "Open Terminal". Then do the following:

    cd zephyr/samples/basic/blinky
    west build -b nrf5340dk_nrf5340_cpuapp --pristine

    That should build without any issues. Does it? For reference, it looks like this on my Mac:

    âžś  v1.8.0 cd zephyr/samples/basic/blinky
    âžś  blinky git:(c932ad1952) west build -b nrf5340dk_nrf5340_cpuapp --pristine
    -- west build: generating a build system
    Including boilerplate (Zephyr base): /opt/nordic/ncs/v1.8.0/zephyr/cmake/app/boilerplate.cmake
    -- Application: /opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky
    -- Using NCS Toolchain 1.8.0 for building. (/opt/nordic/ncs/v1.8.0/toolchain/cmake)
    -- Zephyr version: 2.7.0 (/opt/nordic/ncs/v1.8.0/zephyr), build: v2.7.0-ncs1
    -- Found Python3: /opt/nordic/ncs/v1.8.0/toolchain/bin/python3 (found suitable exact version "3.9.6") found components: Interpreter 
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf5340dk_nrf5340_cpuapp
    -- Cache files will be written to: /Users/eith/Library/Caches/zephyr
    -- Found dtc: /opt/nordic/ncs/v1.8.0/toolchain/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (/opt/nordic/ncs/v1.8.0/toolchain)
    -- Found BOARD.dts: /opt/nordic/ncs/v1.8.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Generated zephyr.dts: /opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: /opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky/build/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: /opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky/build/zephyr/dts.cmake
    Parsing /opt/nordic/ncs/v1.8.0/zephyr/Kconfig
    Loaded configuration '/opt/nordic/ncs/v1.8.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration '/opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky/prj.conf'
    Configuration saved to '/opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky/build/zephyr/.config'
    Kconfig header saved to '/opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky/build/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.1
    -- The CXX compiler identification is GNU 9.2.1
    -- The ASM compiler identification is GNU
    -- Found assembler: /opt/nordic/ncs/v1.8.0/toolchain/bin/arm-none-eabi-gcc
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky/build
    -- west build: building application
    [1/154] Preparing syscall dependency handling
    
    [5/154] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h, include/generated/otype-to-size.h
    /opt/nordic/ncs/v1.8.0/zephyr/scripts/gen_kobject_list.py:66: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      if LooseVersion(elftools.__version__) < LooseVersion('0.24'):
    [6/154] Generating include/generated/driver-validation.h
    /opt/nordic/ncs/v1.8.0/zephyr/scripts/gen_kobject_list.py:66: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      if LooseVersion(elftools.__version__) < LooseVersion('0.24'):
    [147/154] Linking C executable zephyr/zephyr_prebuilt.elf
    
    [150/154] Generating dev_handles.c
    /opt/nordic/ncs/v1.8.0/zephyr/scripts/gen_handles.py:46: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      if LooseVersion(elftools.__version__) < LooseVersion('0.24'):
    [154/154] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       21104 B         1 MB      2.01%
                SRAM:        6200 B       448 KB      1.35%
            IDT_LIST:          0 GB         2 KB      0.00%

    If not, can you let me know which Mac model you have and which macOS version you are using? Also, as you say there are missing files (though I did not see any direct indication of that in the errors here), it could be worth trying to re-install the toolchain from the toolchain manager. We have seen issues in the past where repositories are not completely checked out, and unfortunately the error handling in the toolchain manager is quite sparse at the moment, so in such cases checkout may fail silently.

  • this is what I get from using the macOS Terminal using "Open Terminal" form the Toolchain Manager:

    Last login: Thu Feb  3 14:29:52 on ttys000

    alwalker@Als-MBP-2 ~ % cd /opt/nordic/ncs/v1.8.0 ; export PATH=/opt/nordic/ncs/v1.8.0/toolchain/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin ; export GIT_EXEC_PATH=/opt/nordic/ncs/v1.8.0/toolchain/Cellar/git/2.32.0_1/libexec/git-core ; export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb ; export GNUARMEMB_TOOLCHAIN_PATH=/opt/nordic/ncs/v1.8.0/toolchain ; clear

    alwalker@Als-MBP-2 v1.8.0 % cd zephyr/samples/basic/blinky

    alwalker@Als-MBP-2 blinky % west build -b nrf5340dk_nrf5340_cpuapp --pristine

    -- west build: generating a build system

    Including boilerplate (Zephyr base): /opt/nordic/ncs/v1.8.0/zephyr/cmake/app/boilerplate.cmake

    -- Application: /opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky

    -- Using NCS Toolchain 1.8.0 for building. (/opt/nordic/ncs/v1.8.0/toolchain/cmake)

    -- Zephyr version: 2.7.0 (/opt/nordic/ncs/v1.8.0/zephyr), build: v2.7.0-ncs1

    -- Found Python3: /opt/nordic/ncs/v1.8.0/toolchain/bin/python3 (found suitable exact version "3.9.6") found components: Interpreter 

    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")

    -- Board: nrf5340dk_nrf5340_cpuapp

    -- Cache files will be written to: /Users/alwalker/Library/Caches/zephyr

    -- Found dtc: /opt/nordic/ncs/v1.8.0/toolchain/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")

    -- Found toolchain: gnuarmemb (/opt/nordic/ncs/v1.8.0/toolchain)

    -- Found BOARD.dts: /opt/nordic/ncs/v1.8.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts

    -- Generated zephyr.dts: /opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky/build/zephyr/zephyr.dts

    -- Generated devicetree_unfixed.h: /opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky/build/zephyr/include/generated/devicetree_unfixed.h

    -- Generated device_extern.h: /opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky/build/zephyr/include/generated/device_extern.h

    -- Including generated dts.cmake file: /opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky/build/zephyr/dts.cmake

    Parsing /opt/nordic/ncs/v1.8.0/zephyr/Kconfig

    /opt/nordic/ncs/v1.8.0/zephyr/scripts/kconfig/kconfig.py: samples/basic/blinky/build/Kconfig/Kconfig.modules:38: Could not open '/opt/nordic/ncs/v1.8.0/zephyr/' (in 'osource "$(ZEPHYR_MCUBOOT_KCONFIG)"') (EISDIR: Is a directory)

    CMake Error at /opt/nordic/ncs/v1.8.0/zephyr/cmake/kconfig.cmake:270 (message):

      command failed with return code: 1

    Call Stack (most recent call first):

      /opt/nordic/ncs/v1.8.0/zephyr/cmake/app/boilerplate.cmake:546 (include)

      /opt/nordic/ncs/v1.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)

      /opt/nordic/ncs/v1.8.0/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: /opt/nordic/ncs/v1.8.0/toolchain/bin/cmake -DWEST_PYTHON=/opt/nordic/ncs/v1.8.0/toolchain/opt/[email protected]/bin/python3.9 -B/opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky/build -S/opt/nordic/ncs/v1.8.0/zephyr/samples/basic/blinky -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp

    alwalker@Als-MBP-2 blinky % 

  • Hi,

    Sorry for the delay, I was OoO for a few days.

    I have not been able to reproduce this nor am I able to see anything that sticks out. I discussed this issue with the team behind the toolchain manager, and they wondered what shell you are using? Are you using bash or zsh? Those should work, but if you are using something else like csh or tcsh that may not work. This might not be related at all though, but we do not have any other ideas at the moment. 

  • I am using zsh, which is standard for Terminal in Catalina

  • Is it worth me upgrading to macOS Monterey?

  • Hi,

    It could be. I cannot promise that it will solve this issue though, as we have not been able to reproduce or understand the cause of the issue you are seeing.

  • Hi Einar,

    As the issue with the Programmer was fixed by the latest update, what I’m going to do is upgrade to Monterey and then do a freash install of the latest version of nRF Connect for Desktop and VS Code. That way we’re both working in the same environment.

Reply Children
  • Hi Einar,

    Good news! Having upgraded to macOS Monterey and done a fresh install of both nRF Connect and VS Code (including deleting relevant files from hidden folders), and following the instructions in videos 2 and 3, i can now get the Blinky application to build and then download and run ok on my target nRF5340 DK board.

    I can only assume that rolling back the version of nRF Connect due to the (now fixed) Programmer issue was the cause of the problems. 

    One remaining question, in the list of target boards for nRF5340 there are a number of options including the nrF5340dk_nrf5340_cpuapp that I selected. Is there a definition of what each of these options represents please?

  • Hi,

    I am glad to hear that it was resolved. Thanks for letting us know. That can be useful for others in the future.

    You can see a bit about this under Working with nRF5340 DK. In short:

    • The first part specifies the board, the second part specifies the IC, the third specifies the CPU core, and the optional last specifies if it is for non-secure domain.
      • nrf5340dk_nrf5340_cpuapp is the target for building firmware for the application core in secure mode (so not using a split between secure and non-secure)
      • nrf5340dk_nrf5340_cpuapp is the target for building firmware for the application core in non-secure mode. In this case, there is a split between secure and non-secure. See Application core for more.
      • nrf5340dk_nrf5340_cpunet is for the network core. (There is no HW support for separating between secure and non-secure domains on the network core.)
Related