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,

    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.

Reply Children
  • Hi Griffin,

    Could you please open VS Code, press CTRL+SHIFT+P and type nrf-connect.topdir. Could you please share the value of the nrf-connect.topdir setting under workspace tab?

    Best regards,
    Dejan

  • Hi Dejans,

    Since I'm also having the issue, I thought I'd respond to your diagnostic directions. 

    You said: 

    >>> Could you please open VS Code, press CTRL+SHIFT+P and type nrf-connect.topdir.

    I think you meant CMD+SHIFT+P since I'm on a Mac. CTRL+SHIFT+P does nothing.

    In any case, if I CMD+SHIFT+P and try to type nrf-connect.topdir, it says "no matching results".  

    I've generated my support info and included it below. There is a line in it that says 

    "config": {

    "nordic-semiconductor.nrf-connect": {
    "topdir": "${nrf-connect.sdk:1.9.1}",
    "toolchain": {
    "path": "${nrf-connect.toolchain:1.9.1}"
    },

    Thanks for your help,

    Steve

    IMPORTANT: The data below could contain sensitive or confidential information about your environment.
    If you do not wish this to be seen by others, please make sure to remove it before sharing.
    
    For help and support, visit the Nordic DevZone at https://devzone.nordicsemi.com/.
    
    {
      "platform": {
        "os": "darwin",
        "osVersion": "Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:27 PDT 2021; root:xnu-7195.141.2~5/RELEASE_ARM64_T8101",
        "osKernel": "20.6.0",
        "vscode": "1.65.0",
        "electron": "13.5.2",
        "node": "v14.16.0"
      },
      "system": {
        "date": "2022-03-09T16:22:23.116Z",
        "vscodeRoot": "/Applications/Visual Studio Code.app/Contents/Resources/app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:02:19",
        "osUptime": "27:49:02",
        "cpu": {
          "model": "Apple M1",
          "speed": "24 MHz",
          "count": 4
        },
        "memory": {
          "total": "16.00 GB",
          "free": "0.04 GB"
        }
      },
      "workspace": {
        "name": "ble_dfu_peripheral_lbs",
        "workspaceFile": null,
        "folders": [
          "/Users/Steve/Projects/ble_dfu_peripheral_lbs"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2022.1.192",
            "path": "/Users/Steve/.vscode/extensions/nordic-semiconductor.nrf-connect-2022.1.192",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2022.1.30",
            "path": "/Users/Steve/.vscode/extensions/nordic-semiconductor.nrf-terminal-2022.1.30",
            "isActive": true
          },
          "nordic-semiconductor.devicetree": null,
          "nordic-semiconductor.kconfig": null
        },
        "external": {
          "marus25.cortex-debug": "1.2.2",
          "ms-vscode.cpptools": "1.8.4",
          "ms-vscode.js-debug": "1.65.0",
          "ms-vscode.js-debug-companion": "1.0.15",
          "ms-vscode.references-view": "0.0.85",
          "ms-vscode.vscode-js-profile-table": "0.0.18",
          "cschlosser.doxdocgen": "1.4.0",
          "jeff-hykin.better-cpp-syntax": "1.15.13",
          "ms-vscode-remote.remote-containers": "0.224.2",
          "ms-vscode-remote.remote-ssh": "0.76.1",
          "ms-vscode-remote.remote-ssh-edit": "0.76.1",
          "ms-vscode-remote.remote-wsl": "0.64.2",
          "ms-vscode.cpptools-extension-pack": "1.1.0",
          "ms-vscode.cpptools-themes": "1.0.0",
          "trond-snekvik.gnu-mapfiles": "1.1.0"
        }
      },
      "tools": {
        "/Applications/SEGGER/JLink/JLinkExe": "7.58b",
        "/usr/local/bin/nrfjprog": "10.15.2",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/cmake": "3.21.1",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/west": "0.12.0",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/python3": "3.9.6",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/ninja": "1.10.2",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/gperf": "3.1",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/dtc": "1.6.1",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/arm-none-eabi-gcc": "9-2019-q4-major",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/gn": "1977",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/git": "2.32.0"
      },
      "connectedDevices": [],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:1.9.1}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:1.9.1}"
          },
          "ozonePath": "",
          "applications": [
            "/Users/Steve/Projects/ble_dfu_peripheral_lbs"
          ],
          "jlink": {
            "rtosPlugin": ""
          },
          "kconfig": {
            "interface": "kconfig"
          },
          "welcome": {
            "showOnStartup": false
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "enableTelemetry": true
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "line"
        },
        "nordic-semiconductor.devicetree": {
          "modules": [
            "${zephyrBase}",
            "${zephyrBase}/../nrf",
            "."
          ],
          "zephyr": "",
          "ctxFile": "",
          "defaultBoard": ""
        },
        "nordic-semiconductor.kconfig": {
          "root": "",
          "env": {},
          "cfiles": true,
          "disable": false,
          "zephyr": {
            "base": ""
          },
          "python": "",
          "liveValue": true
        },
        "marus25.cortex-debug": {
          "armToolchainPath": null,
          "armToolchainPrefix": "arm-none-eabi",
          "gdbPath": null,
          "objdumpPath": null,
          "JLinkGDBServerPath": null,
          "openocdPath": null,
          "pyocdPath": null,
          "PEGDBServerPath": null,
          "stutilPath": null,
          "stlinkPath": null,
          "stm32cubeprogrammer": null,
          "enableTelemetry": true,
          "flattenAnonymous": false,
          "registerUseNaturalFormat": true,
          "variableUseNaturalFormat": true,
          "dbgServerLogfile": null,
          "showDevDebugOutput": "none"
        }
      },
      "environment": {
        "westExe": "/opt/nordic/ncs/v1.9.1/toolchain/bin/west",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "GIT_EXEC_PATH": "/opt/nordic/ncs/v1.9.1/toolchain/Cellar/git/2.32.0_1/libexec/git-core",
          "HOME": "/Users/Steve",
          "PATH": "/opt/nordic/ncs/v1.9.1/toolchain/bin:$/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/Steve/share/bin:/usr/local/bin:/Users/Steve/.fastlane/bin:/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Developer/usr/bin:/Users/Steve/bin:/bin:/usr/sbin:/sbin:/usr/bin:/usr/X11/bin:/Users/Steve/bin/svn-scripts/:.:/Users/Steve/Library/Android/sdk/platform-tools:/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Versions/A/Support:/Users/Steve/Library/Android/sdk/tools/:/Users/Steve/Library/Android/sdk/build-tools/current",
          "ZEPHYR_BASE": "/opt/nordic/ncs/v1.9.1/zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "/opt/nordic/ncs/v1.9.1/toolchain",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "USER": "Steve"
        },
        "toolchainPath": "/opt/nordic/ncs/v1.9.1/toolchain",
        "toolchainBinPath": "/opt/nordic/ncs/v1.9.1/toolchain/bin",
        "toolchainVersion": "1.9.1"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }
    
    

  • Hello,

    Much like abvio, replicating your diagnostic actions just results in "No Matching commands". However, if I look at VSCode's settings under the workspace tab I can find what I think your'e looking for:

    Topdir is set to "${nrf-connect.sdk:1.9.0}"

  • Hi,

    The actual command I wanted you to try was CMD+SHIFT+P. It was a mistake on my side.
    Your output Griffin is the one I was expecting to see.

    Best regards,
    Dejan

  • Hi Dejans,

    Now that Griffin and I have provided the information you asked for, what can we do to resolve this issue and build our projects? 

    My project has been dead in the water now for two weeks, and getting DFU to compile and work is critical path. 

    Best,

    Steve

Related