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

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

    I was able to fix my problem by completely uninstalling VS Code again, and then installing the "Universal" version rather than the intel version. Despite this being not recommended, it allowed the toolchain manager to finally be able to actually start VS code (rather than just spin there constantly "checking"), which then fixed my problem.

    My assumption is that the toolchain manager sets some environment variables that enable the build process to actually work.

    At the moment, I'd rather not break my entire development environment again to provide you with the Support Information. However if this issue shows up again, I'll be sure to post and include it. 

    All of that being said, is it possible for the VSCode plugin to set proper variables so that I don't have to launch it via Toolchain manager again (Launching it independently brings up the same build errors.)?

    Also, is it a known issue that Toolchain manager is unable to launch the Intel Build of VS code on M1 Macs? Or is something unique about my system?

    Happy to provide any information if you guys need to further debug the problem.

  • Hi, 

    I was hoping to get "Generate Support Information" from you so that we can better understand what was happening in your case. However, I am glad that you fixed your problem.
    I have also asked about your problem internally and waiting for a reply.

    Best regards,
    Dejan

  • Hello,

    Apologies for the late response, I was pulled away to other projects. I have re-installed the intel build of visual studio code, and let Toolchain Manager (v0.10.3) install all of the recommended plugins. Toolchain manager continues to just sit at "Checking if VS Code and dependencies are installed." and never open VS code. I opened VS code manually and generated support information for you.

    The resulting information is:

    {
      "platform": {
        "os": "darwin",
        "osVersion": "Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101",
        "osKernel": "21.2.0",
        "vscode": "1.64.0",
        "electron": "13.5.2",
        "node": "v14.16.0"
      },
      "system": {
        "date": "2022-02-07T18:20:42.575Z",
        "vscodeRoot": "/Applications/Visual Studio Code.app/Contents/Resources/app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:01:53",
        "osUptime": "121:21:00",
        "cpu": {
          "model": "Apple M1",
          "speed": "24 MHz",
          "count": 4
        },
        "memory": {
          "total": "16.00 GB",
          "free": "0.02 GB"
        }
      },
      "workspace": {
        "name": "firmware",
        "workspaceFile": null,
        "folders": [
          "/Users/griffinmeyer/Desktop/JBC/X3F/firmware"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2022.1.192",
            "path": "/Users/griffinmeyer/.vscode/extensions/nordic-semiconductor.nrf-connect-2022.1.192",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2022.1.30",
            "path": "/Users/griffinmeyer/.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.2",
          "ms-vscode.js-debug": "1.64.2",
          "ms-vscode.js-debug-companion": "1.0.15",
          "ms-vscode.references-view": "0.0.81",
          "ms-vscode.vscode-js-profile-table": "0.0.18",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "/Applications/SEGGER/JLink/JLinkExe": "7.58b",
        "/usr/local/bin/nrfjprog": "10.15.2",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/cmake": "3.21.1",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/west": "0.12.0",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/python3": "3.9.6",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/ninja": "1.10.2",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/gperf": "3.1",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/dtc": "1.6.1",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/arm-none-eabi-gcc": "9-2019-q4-major",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/gn": "1961",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/git": "2.32.0"
      },
      "connectedDevices": [],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:1.8.0}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:1.8.0}"
          },
          "ozonePath": "",
          "applications": [
            "${workspaceFolder}"
          ],
          "jlink": {
            "rtosPlugin": ""
          },
          "kconfig": {
            "interface": "kconfig"
          },
          "welcome": {
            "showOnStartup": false
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "enableTelemetry": true
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        },
        "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.8.0/toolchain/bin/west",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "GIT_EXEC_PATH": "/opt/nordic/ncs/v1.8.0/toolchain/Cellar/git/2.32.0_1/libexec/git-core",
          "HOME": "/Users/griffinmeyer",
          "PATH": "/opt/nordic/ncs/v1.8.0/toolchain/bin:/Users/griffinmeyer/go/bin:/Users/griffinmeyer/.pyenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands",
          "ZEPHYR_BASE": "/opt/nordic/ncs/v1.8.0/zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "/opt/nordic/ncs/v1.8.0/toolchain",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "USER": "griffinmeyer"
        },
        "toolchainPath": "/opt/nordic/ncs/v1.8.0/toolchain",
        "toolchainBinPath": "/opt/nordic/ncs/v1.8.0/toolchain/bin",
        "toolchainVersion": "1.8.0"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }

    It should be of note that I am now seeing "A request has failed. See the output for more information." Source: nRF Kconfig (Extension) errors constantly.

    The output of that error is:

    [Info  - 12:18:56 PM] Parsing...
    [Info  - 12:18:56 PM] Status: False
    [Info  - 12:18:56 PM] Parsing...
    [Info  - 12:18:56 PM] Reloading Zephyr python modules...
    [Info  - 12:18:56 PM] Reloading scripts/dts/python-devicetree/src/devicetree/__init__.py
    [Info  - 12:18:56 PM] Status: False
    [Error - 12:18:56 PM] Request textDocument/documentSymbol failed.
      Message: Exception: "'NoneType' object has no attribute 'lines'"
      Code: -32001 
    Traceback (most recent call last):
      File "/Users/griffinmeyer/.vscode/extensions/nordic-semiconductor.nrf-kconfig-2022.1.78/srv/rpc.py", line 413, in handle
        result = self.handlers[msg.method](self, msg.params)
      File "/Users/griffinmeyer/.vscode/extensions/nordic-semiconductor.nrf-kconfig-2022.1.78/srv/kconfiglsp.py", line 1906, in handle_doc_symbols
        self.refresh_ctx(ctx)
      File "/Users/griffinmeyer/.vscode/extensions/nordic-semiconductor.nrf-kconfig-2022.1.78/srv/kconfiglsp.py", line 1474, in refresh_ctx
        self.notify_changed_values(ctx)
      File "/Users/griffinmeyer/.vscode/extensions/nordic-semiconductor.nrf-kconfig-2022.1.78/srv/kconfiglsp.py", line 1484, in notify_changed_values
        for e in conf_file.entries():
      File "/Users/griffinmeyer/.vscode/extensions/nordic-semiconductor.nrf-kconfig-2022.1.78/srv/kconfiglsp.py", line 613, in entries
        for linenr, line in enumerate(self.doc.lines):
    AttributeError: 'NoneType' object has no attribute 'lines'

Related