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!

  • 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 % 

  • Computer Specification

    Hardware Overview:

      Model Name: MacBook Pro

      Model Identifier: MacBookPro12,1

      Processor Name: Dual-Core Intel Core i7

      Processor Speed: 3.1 GHz

      Number of Processors: 1

      Total Number of Cores: 2

      L2 Cache (per Core): 256 KB

      L3 Cache: 4 MB

      Hyper-Threading Technology: Enabled

      Memory: 16 GB

      Boot ROM Version: 428.60.3.0.0

      SMC Version (system): 2.28f7

    Operating System  

    macOS Catalina 10.15.7

    It's not a case of missing files, rather that the Kconfig file can't be located and whilst the C header files exist, where they are put in the macOS file system is not colocated with the Workspace folder.

  • As it seems that there is a CMake error, this is what I have installed:

    This is the Toolchain folder structure:

  • I see you use Catalina. I don't know of any specific reason it should not work, but we only do release testing with the latest macOS. So there could be something there. It does not seem likely though, as the error is this (for reference):

    /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

    And the exact same error is reported from Cmake in this old thread. It does not seem it ever got resolved, though.

    alwalker said:
    It's not a case of missing files, rather that the Kconfig file can't be located and whilst the C header files exist, where they are put in the macOS file system is not colocated with the Workspace folder.

    I did not get this? But in any case, I really suggest we skip VSCode (if that is what you refer to by workspace), as this issue is clearly not related to it as you also reproduce it by using west directly. The fewer variables in the mix, the better.

    As I currently don't see anything sticking out, I want to just check another idea which sometimes cause issues on macOS. Which filesystem do you have?

Related