Unable to start debugging in VS Code when not executed as admin

Hi community,

I was changing the IDE from SES to VS Code and got everything running fine except debugging.

If i execute VS Code as administrator debugging works as supposed.

Starting debugging in VS Code as user will emit the following error message:

Well, J-Link is properly installed and the registry key seems to be properly defined, too:

Since i don't know how VS Code and OS registry work in this case, i cannot detect the error.

Please help me out here!

Thanks in advance, best greets

AleBeBu

Parents Reply Children
  • Hi again,

    just wanted to add the generate support information output when executing VS Code as admin.

    Obviously JLink.exe path is added here in tools. How can I edit this setting in VS Code or the corresponding JSON-config-file?

    {
      "platform": {
        "os": "win32",
        "osVersion": "Windows 10 Enterprise",
        "osKernel": "10.0.19044",
        "vscode": "1.64.2",
        "electron": "13.5.2",
        "node": "v14.16.0"
      },
      "system": {
        "date": "2022-02-28T13:56:14.703Z",
        "vscodeRoot": "c:\\Program Files\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:00:14",
        "osUptime": "06:20:12",
        "cpu": {
          "model": "Intel(R) Core(TM) i5-10310U CPU @ 1.70GHz",
          "speed": "2208 MHz",
          "count": 4
        },
        "memory": {
          "total": "15.65 GB",
          "free": "6.36 GB"
        }
      },
      "workspace": {
        "name": "Untitled (Workspace)",
        "workspaceFile": "1646035407724",
        "folders": [
          "c:\\Users\\la00181912\\Documents\\blinky"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2022.1.192",
            "path": "c:\\Users\\la00181912\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2022.1.192",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2022.1.30",
            "path": "c:\\Users\\la00181912\\.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-remote.remote-wsl-recommender": "0.0.12",
          "ms-vscode.js-debug": "1.64.3",
          "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": {
        "C:\\Program Files\\SEGGER\\JLink\\JLink.exe": "7.62a",
        "C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.15.0",
        "c:\\ncs\\v1.9.0\\toolchain\\opt\\bin\\cmake.exe": "3.20.5",
        "c:\\ncs\\v1.9.0\\toolchain\\opt\\bin\\Scripts\\west.exe": "0.12.0",
        "c:\\ncs\\v1.9.0\\toolchain\\opt\\bin\\python.exe": "3.8.2",
        "c:\\ncs\\v1.9.0\\toolchain\\opt\\bin\\ninja.exe": "1.9.0",
        "c:\\ncs\\v1.9.0\\toolchain\\opt\\bin\\gperf.exe": "3.1",
        "c:\\ncs\\v1.9.0\\toolchain\\opt\\bin\\dtc.exe": "1.4.7",
        "c:\\ncs\\v1.9.0\\toolchain\\opt\\bin\\arm-none-eabi-gcc.exe": "9-2019-q4-major",
        "c:\\ncs\\v1.9.0\\toolchain\\opt\\bin\\gn.exe": "1975",
        "c:\\ncs\\v1.9.0\\toolchain\\mingw64\\bin\\git.exe": "2.26.2.windows.1"
      },
      "connectedDevices": [
        {
          "id": "683138305"
        }
      ],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "c:\\ncs\\v1.9.0",
          "toolchain": {
            "path": "c:\\ncs\\v1.9.0\\toolchain"
          },
          "ozonePath": "",
          "applications": [],
          "jlink": {
            "rtosPlugin": ""
          },
          "kconfig": {
            "interface": "kconfig"
          },
          "welcome": {
            "showOnStartup": false
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "enableTelemetry": false
        },
        "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": "c:\\ncs\\v1.9.0\\toolchain\\opt\\bin\\Scripts\\west.exe",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\la00181912",
          "Path": "c:\\ncs\\v1.9.0\\toolchain\\mingw64\\bin;c:\\ncs\\v1.9.0\\toolchain\\mingw64\\libexec\\git-core;c:\\ncs\\v1.9.0\\toolchain\\opt\\bin;c:\\ncs\\v1.9.0\\toolchain\\opt\\bin\\Scripts;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files\\Python\\Scripts\\;C:\\Program Files\\Python\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files (x86)\\PuTTY\\;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Program Files\\PowerShell\\7\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\SEGGER\\JLink;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Users\\la00181912\\AppData\\Local\\Microsoft\\WindowsApps",
          "ZEPHYR_BASE": "c:\\ncs\\v1.9.0\\zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "c:\\ncs\\v1.9.0\\toolchain\\opt",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "PYTHONPATH": "c:\\ncs\\v1.9.0\\toolchain\\opt\\bin;c:\\ncs\\v1.9.0\\toolchain\\opt\\bin\\Lib;c:\\ncs\\v1.9.0\\toolchain\\opt\\bin\\Lib\\site-packages",
          "Python3_ROOT": "c:\\ncs\\v1.9.0\\toolchain\\opt\\bin"
        },
        "toolchainPath": "c:\\ncs\\v1.9.0\\toolchain",
        "toolchainBinPath": "c:\\ncs\\v1.9.0\\toolchain\\opt\\bin",
        "toolchainVersion": "1.9.0"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }

    Thanks

    Alebebu

Related