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


  • 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

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

Children
  • Can you please run the Generate support information command one more time after reinstalling the nRF Connect SDK? Make sure to start VS code from the Toolchain Manager to verify functionality. 

  • Thanks for coming back Oyvind. I have reinstalled it again this morning this time version 1.8  with the same results.

    Build process work 100% but it look like its saying there is no compiler installed or associated with the project.

    below the logs


    {
      "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-03-01T13:09:27.803Z",
        "vscodeRoot": "c:\\Users\\meltb\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "03:00:39",
        "osUptime": "04:52:50",
        "cpu": {
          "model": "Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz",
          "speed": "1800 MHz",
          "count": 4
        },
        "memory": {
          "total": "7.89 GB",
          "free": "1.19 GB"
        }
      },
      "workspace": {
        "name": "Untitled (Workspace)",
        "workspaceFile": "1646126451190",
        "folders": [
          "e:\\aacrs\\nrfconnectvstudiosdk\\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",
        "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin\\cmake.exe": "3.20.5",
        "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin\\Scripts\\west.exe": "0.12.0",
        "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin\\python.exe": "3.8.2",
        "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin\\ninja.exe": "1.9.0",
        "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin\\gperf.exe": "3.1",
        "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin\\dtc.exe": "1.4.7",
        "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin\\arm-none-eabi-gcc.exe": "9-2019-q4-major",
        "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin\\gn.exe": "1959",
        "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\mingw64\\bin\\git.exe": "2.26.2.windows.1"
      },
      "connectedDevices": [
        {
          "id": "683015900"
        }
      ],
      "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": "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin\\Scripts\\west.exe",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\meltb",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\meltb",
          "Path": "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\mingw64\\bin;e:\\sdknordicvstudio\\v1.8.0\\toolchain\\mingw64\\libexec\\git-core;e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin;e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin\\Scripts;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files (x86)\\AMD\\ATI.ACE\\Core-Static;C:\\Program Files\\nodejs\\;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\PuTTY\\;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin;C:\\Program Files (x86)\\IVI Foundation\\VISA\\WinNT\\Bin\\;C:\\Program Files\\IVI Foundation\\VISA\\Win64\\Bin\\;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\meltb\\AppData\\Local\\Microsoft\\WindowsApps;C:\\OpenSSL-Win32\\bin;{\"properties\":{\"Status\":\"Success\"},\"event\":\"Install Done\",\"context\":{\"os\":{\"name\":\"Windows\",\"version\":\"10.0 (64 bit)\"}},\"anonymousId\":\"melt\\\\meltb S-1-5-21-2555264595-3629887821-3525399194-1001\\r\\n\"};C:\\Users\\meltb\\AppData\\Roaming\\npm;C:\\Users\\meltb\\AppData\\Local\\particle\\bin;C:\\Users\\meltb\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\meltb\\AppData\\Local\\Programs\\Microsoft VS Code\\bin",
          "ZEPHYR_BASE": "e:\\sdknordicvstudio\\v1.8.0\\zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "PYTHONPATH": "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin;e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin\\Lib;e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin\\Lib\\site-packages",
          "Python3_ROOT": "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin"
        },
        "toolchainPath": "e:\\sdknordicvstudio\\v1.8.0\\toolchain",
        "toolchainBinPath": "e:\\sdknordicvstudio\\v1.8.0\\toolchain\\opt\\bin",
        "toolchainVersion": "1.8.0"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }
     
  • Dont now if this will help, It appears to be a cmake problem and under the extension the following warning

  • From the support information that you provided I can't see any issues. All tools are correctly installed from what I can see. You should be able to build a project in VS Code. 

    melt said:
    Build process work 100% but it look like its saying there is no compiler installed or associated with the project.

    Do you mean that the project built without issues? Are you able to flash your device with the project?

    In VS Code are you able to see the output from when building the project? This can be found in the built-in terminal in VS Code. Go to Terminal --> New terminal. Then click on the Terminal tab to see output when building.

  • Thanks for all you help and patience with this Oyvind. After much installing and reinstalling (everytime to a different path) I can now build and flash successfully

    just one question on the below selection which should I choose (I have not selected anything this time and all is working before I selected Json.

    2nd question I see the encircled option are not the same, the top is compile and the on the nrf SDK is Build. I was using the top one hence my compile problem.

    Thanks again for the help

Related