This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

VS studio not building samples

Goodday

I thought I would try the webinar 

Desktop️ nRF Connect for VS Code Webinar - Hackster.io

Im getting the following error after I add Build configuration

Building hid3534
west build --build-dir e:\aacrs\02_12\nordic\vs_remote_tutorial\hid\hid3534\build e:\aacrs\02_12\nordic\vs_remote_tutorial\hid\hid3534 --pristine --board nrf52840dk_nrf52840 -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE"

usage: west [-h] [-z ZEPHYR_BASE] [-v] [-V] <command> ...
west: error: argument <command>: invalid choice: 'build' (choose from 'init', 'update', 'list', 'manifest', 'diff', 'status', 'forall', 'help', 'config', 'topdir', 'selfupdate')
The terminal process terminated with exit code: 2.

I have uninstalled and reinstalled both vs code and nRf connect..

My connected 52840 DK does show up in connected devices.

Parents
  • Hello, 

    Can you please provide the output from running the following from the VS code command pallette:



    Have you verified that the toolchain path is correct

    Kind regards,
    Øyvind

  • hi Oyvind

    yes tool chain path is correct


    General support info below

    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 devzone.nordicsemi.com/.

    {
      "platform": {
        "os": "win32",
        "osVersion": "Windows 10 Pro",
        "osKernel": "10.0.19043",
        "vscode": "1.64.2",
        "electron": "13.5.2",
        "node": "v14.16.0"
      },
      "system": {
        "date": "2022-02-28T10:13:32.043Z",
        "vscodeRoot": "c:\\Users\\meltb\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "00:01:02",
        "osUptime": "02:18:37",
        "cpu": {
          "model": "Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz",
          "speed": "1800 MHz",
          "count": 4
        },
        "memory": {
          "total": "7.89 GB",
          "free": "1.74 GB"
        }
      },
      "workspace": {
        "name": "Untitled (Workspace)",
        "workspaceFile": "1646035652424",
        "folders": [
          "e:\\aacrs\\02_12\\nordic\\vs_remote_tutorial\\test\\hello_world"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2022.1.192",
            "path": "c:\\Users\\meltb\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2022.1.192",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2022.1.30",
            "path": "c:\\Users\\meltb\\.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",
          "cschlosser.doxdocgen": "1.4.0",
          "jeff-hykin.better-cpp-syntax": "1.15.13",
          "ms-vscode-remote.remote-containers": "0.217.4",
          "ms-vscode-remote.remote-ssh": "0.74.0",
          "ms-vscode-remote.remote-ssh-edit": "0.74.0",
          "ms-vscode-remote.remote-wsl": "0.64.2",
          "ms-vscode.cmake-tools": "1.9.2",
          "ms-vscode.cpptools-extension-pack": "1.1.0",
          "ms-vscode.cpptools-themes": "1.0.0",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "C:\\Program Files (x86)\\SEGGER\\JLink\\JLink.exe": "7.58b",
        "C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.15.3",
        "cmake": "Not found",
        "west": "Not found",
        "C:\\Users\\meltb\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe": null,
        "ninja": "Not found",
        "gperf": "Not found",
        "dtc": "Not found",
        "gnuarmemb": "Not found",
        "gn": "Not found",
        "C:\\Program Files\\Git\\cmd\\git.exe": "2.27.0.windows.1"
      },
      "connectedDevices": [
        {
          "id": "683015900"
        }
      ],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "",
          "toolchain": {
            "path": ""
          },
          "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": "west",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\meltb",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\meltb"
        }
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }


  • Thanks for providing this information. From the output I can see that the path is not configured correctly in VS Code. 

    To what path did you install the nRF Connect SDK (NCS) to? Have you installed NCS using the Toolchain Manager?

    Thanks.

    -Øyvind

  • Yes I used nRF connect which installed it to the default \ncs folder under \user directory. My actual nordic SDK and softdevices  lies on a different drive E:\aacrs\02_12\nordic\SDK\nRF5_SDK_17.1.0. this is also the drive I use for Segger.

    I keep  my custom projects within the \example folder of   \nrf_SDK17.1 

Reply
  • Yes I used nRF connect which installed it to the default \ncs folder under \user directory. My actual nordic SDK and softdevices  lies on a different drive E:\aacrs\02_12\nordic\SDK\nRF5_SDK_17.1.0. this is also the drive I use for Segger.

    I keep  my custom projects within the \example folder of   \nrf_SDK17.1 

Children
  • Please note that nRF Connect SDK is not the same as nRF5 SDK. 

    The VS Code extension only supports the nRF Connect SDK.

  • Then nrf Connect SDK has loaded the vs Studio tool chains and installed the extensions as per default.

    I cant see why it would not be working

  • Øyvind said:
    From the output I can see that the path is not configured correctly in VS Code. 

    Did you open VS Code from the Toolchain Manager as demonstrated in the Hackster.io webinar? If so, this should configure the VS Code extension with correct settings. 

    From the support information you provided, we can see that none of the tools from the toolchain is configured

     "tools": {
        "C:\\Program Files (x86)\\SEGGER\\JLink\\JLink.exe": "7.58b",
        "C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.15.3",
        "cmake": "Not found",
        "west": "Not found",
        "C:\\Users\\meltb\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe": null,
        "ninja": "Not found",
        "gperf": "Not found",
        "dtc": "Not found",
        "gnuarmemb": "Not found",
        "gn": "Not found",
        "C:\\Program Files\\Git\\cmd\\git.exe": "2.27.0.windows.1"
      },

    From my installation is looks like this

     "tools": {
        "C:\\Program Files (x86)\\SEGGER\\JLink\\JLink.exe": "7.58b",
        "C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.15.0",
        "c:\\NordicSemi\\v1.9.0\\toolchain\\opt\\bin\\cmake.exe": "3.20.5",
        "c:\\NordicSemi\\v1.9.0\\toolchain\\opt\\bin\\Scripts\\west.exe": "0.12.0",
        "c:\\NordicSemi\\v1.9.0\\toolchain\\opt\\bin\\python.exe": "3.8.2",
        "c:\\NordicSemi\\v1.9.0\\toolchain\\opt\\bin\\ninja.exe": "1.9.0",
        "c:\\NordicSemi\\v1.9.0\\toolchain\\opt\\bin\\gperf.exe": "3.1",
        "c:\\NordicSemi\\v1.9.0\\toolchain\\opt\\bin\\dtc.exe": "1.4.7",
        "c:\\NordicSemi\\v1.9.0\\toolchain\\opt\\bin\\arm-none-eabi-gcc.exe": "9-2019-q4-major",
        "c:\\NordicSemi\\v1.9.0\\toolchain\\opt\\bin\\gn.exe": "1975",
        "c:\\NordicSemi\\v1.9.0\\toolchain\\mingw64\\bin\\git.exe": "2.26.2.windows.1"
      },

    Can you please provide the path of the nRF Connect SDK folder and the content of this folder?

  • That caught my eye as well, the non configured tools. Yes, I did it all from nRf connect SDK, I have done this 3 times uninstall and start with clean installations

    Is the below the connect SDK folder you asking about?

  • After checking the above, I decided to delete the NCS folder completely. I then reinstalled it from nrf connect but this time I did it from the zip file and did it to a custom folder. it looks slightly different

    before it had .vscode and now it has .west.

    After adding a simple example "hello world" the first build started correctly but failed with include files not found. I then restarted VS and get the following error when compiling

Related