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

Parents
  • In an attempt at debugging, I installed the 1.7.1 SDK, that provides me with a ton of "warning: the hex symbol PM_PARTITION_SIZE_MCUBOOT  has a non-hex default FPROTECT_BLOCK_SIZE (undefined)" errors on MCUBoot build. It seems as if something is severely broken in my mcuboot files, but re-installing does nothing...

  • Hi,

    Could you please send us "Generate Support Information"?
    In order to get this report, please open VS Code, press Cmd-Shift-P on a Mac (Ctrl-Shift-P on a Mac) and start typing "Generate Support Information". The report will be opened in the Output pane. Please copy this report and send it back to me.

    In addition, please try building the application with the "west" command line tool and check the status of the west manifest as described in the documentation. Afterwards, please provide information on the results.

    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.

  •  If you install the arm version of VS Code, Connect for Desktop should open it (and warn you it's not supported) and it SHOULD then build projects with MCUBoot.

    Obviously this is a hassle as then other features do not work as expected, but it's a workout around to at least get something to build if you need the boot loader.

    I've seen other posts that suggest a full re-install of ALL nordic tools AND (Intel)VSCode will make it so that VS code can properly build projects with MCU Boot, but Connect for desktop is still unable to actually open Intel VSCode on its own.

  • Hi Griffin, thanks so much for suggesting a solution to my issue.

    I installed the arm version of VS Code, and you are right that nRF Connect for Desktop was able to launch it with the warning. However, it didn't allow me to build the ble_dfu_peripheral_lbs example.  Same error as before involving not finding file paths including ""$(ZEPHYR_NRF_MODULE_DIR)". A pristine build also could not find build.ninja. 

    I'm wondering if a full reinstall can help. Might give that a try. My backup plan is to drag out an old intel Mac.  

    Thanks again,

    Steve

Reply
  • Hi Griffin, thanks so much for suggesting a solution to my issue.

    I installed the arm version of VS Code, and you are right that nRF Connect for Desktop was able to launch it with the warning. However, it didn't allow me to build the ble_dfu_peripheral_lbs example.  Same error as before involving not finding file paths including ""$(ZEPHYR_NRF_MODULE_DIR)". A pristine build also could not find build.ninja. 

    I'm wondering if a full reinstall can help. Might give that a try. My backup plan is to drag out an old intel Mac.  

    Thanks again,

    Steve

Children
No Data
Related