Sudden Build Errors in Visual Studio Code

Hello,

Up until today I had been developing fine with visual studio code, installed via Toolchain Manager. Then, I clicked "Pristine Build" for the first time in a few days. All of a sudden the build failed and now nothing requiring MCUboot will build properly. 

The error I'm seeing is this, when the build gets to the stage of building McuBoot:

/opt/nordic/ncs/v1.8.0/zephyr/scripts/kconfig/kconfig.py: /opt/nordic/ncs/v1.8.0/bootloader/mcuboot/boot/zephyr/Kconfig:11: '/modules/mcuboot/boot/zephyr/Kconfig' not found (in 'source "$(ZEPHYR_NRF_MODULE_DIR)/modules/mcuboot/boot/zephyr/Kconfig"'). Check that environment variables are set correctly (e.g. $srctree, which is set to '/opt/nordic/ncs/v1.8.0/zephyr'). Also note that unset environment variables expand to the empty string.

 

I've tried: 

Uninstalling and re-installing nRF Connect SDK v1.8.0 from the Toolchain manager

Uninstalling and reinstalling Visual Studio code, and then all of its required plugins via Toolchain Manager.

Building a default project that utilizes Mcuboot, that build also fails in the same way that mine does.

An additional thing of note is that when I click "Open VS Code" from within toolchain manager, it will never actually open VS Code. If code isn't installed or is missing plugins, then it will suggest I install them, but then it will just sit on the "Checking iv VS Code and dependencies are installed" screen indefinitely, never doing anything after that.

I am on an M1 Mac, and I am using all Intel versions of software, as suggested. 

Again, everything was working fine yesterday. I have no idea what could have caused this. I hope you guys will have some ideas!

Thanks

  • Hi,

    Could you please install NCS v1.9.0 and reply whether the problem persists or not?

    Best regards,
    Dejan

  • Hi,

    Does anything change with with NCS v1.9.0?

    Best regards,
    Dejan

  • Hi Dejan,

    I installed NCS v.1.9.1 and went through the steps, and the issues still persist.  

    1) When I launch Nordic Connect for Desktop, and then the Toolchain Manager, when I click "Open VS Code" to the right of v1.9.1, an alert comes up that says "Checking if VS Code and dependencies are installed" that continues forever. 

    2) When I follow this how-to about adding DFU support to an app, it fails during a pristine build. 

    https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu

    The failure log is noted below. 

    I am on an M1 MacBook Air running macOS 11.5.2 Big Sur and the Intel version of VS Code. 

    Best,

    Steve

    /opt/nordic/ncs/v1.9.1/zephyr/scripts/kconfig/kconfig.py: /opt/nordic/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr/Kconfig:11: '/modules/mcuboot/boot/zephyr/Kconfig' not found (in 'source "$(ZEPHYR_NRF_MODULE_DIR)/modules/mcuboot/boot/zephyr/Kconfig"'). Check that environment variables are set correctly (e.g. $srctree, which is set to '/opt/nordic/ncs/v1.9.1/zephyr'). Also note that unset environment variables expand to the empty string.
    CMake Error at /opt/nordic/ncs/v1.9.1/zephyr/cmake/kconfig.cmake:272 (message):
    command failed with return code: 1
    Call Stack (most recent call first):
    /opt/nordic/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake:544 (include)
    /opt/nordic/ncs/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
    /opt/nordic/ncs/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
    /Users/Steve/Projects/ble_dfu_peripheral_lbs/build/CMakeLists.txt:44 (find_package)

  • I'll also add another symptom that might help you diagnose what is going on.  My project (without MCU Boot) compiles without error and runs, but VSCode is a bit confused about include directories. See this screenshot regarding including hal/nrf_gpio.h. -- Steve

  • Hello, when I got my new machine it was a completely fresh install with NCS v1.9.0. Same exact problem of "Checking if VS Code and dependencies are installed" which never goes away. However Connect for Desktop WILL open VS code if it is the NON-Intel version.

Related