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

  • 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

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

Reply
  • 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
      }
    }
    
    

Children
No Data
Related