usage: west: error: argument : invalid choice: 'build'

Hi,

I'm a real novice with this but I'm having this issue and I can't see how to resolve it.

Building HeartRate_sensor
west build --build-dir c:\Users\deirdre.hackett\Nordic\VS_projects\HeartRate_sensor\build c:\Users\anon\Nordic\VS_projects\HeartRate_sensor --pristine --board nrf52840dk_nrf52840 -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="c:/Users/anon/Nordic/VS_projects/HeartRate_sensor"

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 failed to launch (exit code: 2).

[12:31:43] west build --build-dir c:\Users\anon\Nordic\VS_projects\HeartRate_sensor\build c:\Users\anon\Nordic\VS_projects\HeartRate_sensor
[12:32:15] Success.
[12:32:44] west build --build-dir c:\Users\anon\Nordic\VS_projects\HeartRate_sensor\build c:\Users\anon\Nordic\VS_projects\HeartRate_sensor
[12:32:45] Success.
[12:32:46] west flash -d c:\Users\anon\Nordic\VS_projects\HeartRate_sensor\build --skip-rebuild -r nrfjprog --snr 683130583
[12:33:03] Success.
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.19044",
"vscode": "1.62.3",
"electron": "13.5.2",
"node": "v14.16.0"
},
"system": {
"date": "2022-05-19T12:06:22.296Z",
"vscodeRoot": "c:\\Program Files\\Microsoft VS Code\\resources\\app",
"nrfConnectForDesktopInstalled": true,
"vscodeUptime": "00:37:37",
"osUptime": "03:29:08",
"cpu": {
"model": "11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz",
"speed": "1498 MHz",
"count": 4
},
"memory": {
"total": "15.73 GB",
"free": "7.34 GB"
}
},
"workspace": {
"name": "Untitled (Workspace)",
"workspaceFile": "1652798537766",
"folders": [
"c:\\Users\\anon\\Nordic\\VS_projects\\HeartRate_sensor"
]
},
"extensions": {
"internal": {
"nordic-semiconductor.nrf-connect": {
"version": "2022.1.192",
"path": "c:\\Users\\anon\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2022.1.192",
"isActive": true
},
"nordic-semiconductor.nrf-terminal": {
"version": "2022.4.61",
"path": "c:\\Users\\anon\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2022.4.61",
"isActive": true
},
"nordic-semiconductor.devicetree": null,
"nordic-semiconductor.kconfig": null
},
"external": {
"marus25.cortex-debug": "0.4.10",
"ms-vscode.cpptools": "1.7.1",
"ms-vscode-remote.remote-wsl-recommender": "0.0.12",
"ms-vscode.js-debug": "1.62.0",
"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.cmake-tools": "1.9.2",
"ms-vscode.cpptools-extension-pack": "1.2.0",
"ms-vscode.cpptools-themes": "1.0.0",
"redhat.vscode-yaml": "1.7.0",
"trond-snekvik.gnu-mapfiles": "1.1.0",
"twxs.cmake": "0.0.17"
}
},
"tools": {
"C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.15.4",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\cmake.exe": "3.20.5",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Scripts\\west.exe": "0.12.0",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\python.exe": "3.8.2",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\ninja.exe": "1.9.0",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\gperf.exe": "3.1",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\dtc.exe": "1.4.7",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\arm-none-eabi-gcc.exe": "9-2019-q4-major",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\gn.exe": "1977",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\mingw64\\bin\\git.exe": "2.26.2.windows.1"
},
"connectedDevices": [
{
"id": "683130583"
}
],
"config": {
"nordic-semiconductor.nrf-connect": {
"topdir": "c:\\Users\\anon\\ncs\\v1.9.1",
"toolchain": {
"path": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain"
},
"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": "C:\\Program Files\\Python36\\python.exe",
"liveValue": true
},
"marus25.cortex-debug": {
"armToolchainPath": null,
"armToolchainPrefix": "arm-none-eabi",
"gdbPath": 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
}
},
"environment": {
"westExe": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Scripts\\west.exe",
"westEnv": {
"ELECTRON_RUN_AS_NODE": "1",
"HOME": "C:\\Users\\anon",
"HOMEDRIVE": "C:",
"HOMEPATH": "\\Users\\anon",
"Path": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\mingw64\\bin;c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\mingw64\\libexec\\git-core;c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin;c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Scripts;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\Wolfram Research\\WolframScript\\;C:\\Program Files\\MATLAB\\R2020b\\runtime\\win64;C:\\Program Files\\MATLAB\\R2020b\\bin;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Program Files\\PuTTY\\;C:\\Program Files\\nodejs\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\anon\\AppData\\Local\\Microsoft\\WindowsApps;",
"ZEPHYR_BASE": "c:\\Users\\anon\\ncs\\v1.9.1\\zephyr",
"GNUARMEMB_TOOLCHAIN_PATH": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt",
"ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
"PYTHONPATH": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin;c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Lib;c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Lib\\site-packages",
"Python3_ROOT": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin"
},
"toolchainPath": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain",
"toolchainBinPath": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin",
"toolchainVersion": "1.9.1"
},
"terminal": {
"shell": null,
"defaultProfile": null
}
}

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.19044",
"vscode": "1.62.3",
"electron": "13.5.2",
"node": "v14.16.0"
},
"system": {
"date": "2022-05-19T12:06:54.056Z",
"vscodeRoot": "c:\\Program Files\\Microsoft VS Code\\resources\\app",
"nrfConnectForDesktopInstalled": true,
"vscodeUptime": "00:38:08",
"osUptime": "03:29:40",
"cpu": {
"model": "11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz",
"speed": "1498 MHz",
"count": 4
},
"memory": {
"total": "15.73 GB",
"free": "7.27 GB"
}
},
"workspace": {
"name": "Untitled (Workspace)",
"workspaceFile": "1652798537766",
"folders": [
"c:\\Users\\anon\\Nordic\\VS_projects\\HeartRate_sensor"
]
},
"extensions": {
"internal": {
"nordic-semiconductor.nrf-connect": {
"version": "2022.1.192",
"path": "c:\\Users\\anon\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2022.1.192",
"isActive": true
},
"nordic-semiconductor.nrf-terminal": {
"version": "2022.4.61",
"path": "c:\\Users\\anon\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2022.4.61",
"isActive": true
},
"nordic-semiconductor.devicetree": null,
"nordic-semiconductor.kconfig": null
},
"external": {
"marus25.cortex-debug": "0.4.10",
"ms-vscode.cpptools": "1.7.1",
"ms-vscode-remote.remote-wsl-recommender": "0.0.12",
"ms-vscode.js-debug": "1.62.0",
"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.cmake-tools": "1.9.2",
"ms-vscode.cpptools-extension-pack": "1.2.0",
"ms-vscode.cpptools-themes": "1.0.0",
"redhat.vscode-yaml": "1.7.0",
"trond-snekvik.gnu-mapfiles": "1.1.0",
"twxs.cmake": "0.0.17"
}
},
"tools": {
"C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.15.4",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\cmake.exe": "3.20.5",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Scripts\\west.exe": "0.12.0",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\python.exe": "3.8.2",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\ninja.exe": "1.9.0",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\gperf.exe": "3.1",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\dtc.exe": "1.4.7",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\arm-none-eabi-gcc.exe": "9-2019-q4-major",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\gn.exe": "1977",
"c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\mingw64\\bin\\git.exe": "2.26.2.windows.1"
},
"connectedDevices": [
{
"id": "683130583"
}
],
"config": {
"nordic-semiconductor.nrf-connect": {
"topdir": "c:\\Users\\anon\\ncs\\v1.9.1",
"toolchain": {
"path": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain"
},
"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": "C:\\Program Files\\Python36\\python.exe",
"liveValue": true
},
"marus25.cortex-debug": {
"armToolchainPath": null,
"armToolchainPrefix": "arm-none-eabi",
"gdbPath": 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
}
},
"environment": {
"westExe": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Scripts\\west.exe",
"westEnv": {
"ELECTRON_RUN_AS_NODE": "1",
"HOME": "C:\\Users\\anon",
"HOMEDRIVE": "C:",
"HOMEPATH": "\\Users\\anon",
"Path": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\mingw64\\bin;c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\mingw64\\libexec\\git-core;c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin;c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Scripts;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\Wolfram Research\\WolframScript\\;C:\\Program Files\\MATLAB\\R2020b\\runtime\\win64;C:\\Program Files\\MATLAB\\R2020b\\bin;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Program Files\\PuTTY\\;C:\\Program Files\\nodejs\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\anon\\AppData\\Local\\Microsoft\\WindowsApps;",
"ZEPHYR_BASE": "c:\\Users\\anon\\ncs\\v1.9.1\\zephyr",
"GNUARMEMB_TOOLCHAIN_PATH": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt",
"ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
"PYTHONPATH": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin;c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Lib;c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Lib\\site-packages",
"Python3_ROOT": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin"
},
"toolchainPath": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain",
"toolchainBinPath": "c:\\Users\\anon\\ncs\\v1.9.1\\toolchain\\opt\\bin",
"toolchainVersion": "1.9.1"
},
"terminal": {
"shell": null,
"defaultProfile": null
}
}

Parents
  • When I select scan for kits nothing happens 

    When i select unspecified:

    [variant] Loaded new set of variants
    [kit] Successfully loaded 0 kits from C:\Users\deirdre.hackett\AppData\Local\CMakeTools\cmake-tools-kits.json
    [kit] Successfully loaded 0 kits from C:\Users\deirdre.hackett\AppData\Local\CMakeTools\cmake-tools-kits.json
    [main] Configuring folder: hello_world_test5
Reply
  • When I select scan for kits nothing happens 

    When i select unspecified:

    [variant] Loaded new set of variants
    [kit] Successfully loaded 0 kits from C:\Users\deirdre.hackett\AppData\Local\CMakeTools\cmake-tools-kits.json
    [kit] Successfully loaded 0 kits from C:\Users\deirdre.hackett\AppData\Local\CMakeTools\cmake-tools-kits.json
    [main] Configuring folder: hello_world_test5
Children
  • Hi Deidre,

    Dtyn said:
    I was trying to anonimise myself but it didn't work obviously Slight smile

    Sorry, your name was visible in the path. Sweat smile

    Dtyn said:
    I resolved this by uninstalling the SDK and reinstalling in another folder.

    I'm happy to hear you solved the initial issue.

    Dtyn said:
    Should I continue in this question or start a new one?

    As it is not related to original topic of the ticket, you should register a new ticket. That said, the "select a kit for..." message is not related to the nRF Connect for VS Code extension but another extension in VS Code I believe. It is unfortunately misleading, and it can be ignored.

    In you case, you should check what devices are connected under "Connected devices" in the nRF Connect extension

    I will forward your feedback to our VS code extension team, as this is valuable information in regards to user experience. 

    Dtyn said:

    When I try to debug it gives me the message 

    Unable to start debugging: Unable to find J-Link directory to find JLinkGDBServerCL executable. Please make sure that J-Link is installed and that the 'HKEY_LOCAL_MACHINE\Software\SEGGER\J-Link' registry key is defined correctly.

    What debug button are you clicking? Make sure to use the one in our extension: 

    Kind regards,
    Øyvind

  • Thanks for your reply.

    I've created another ticket to continue this issue.

    To answer your last question:

     Yes I am definitely pressing the debug button in the nRF Connect extension.

    My admin installed everything in his admin profile other than VS code that he installed as a network device.

    Let me know if there other information you need to see.

    Is this an issue with an environment variable or registry key?

  • Dtyn said:
    I've created another ticket to continue this issue.

    Thank you! I hope that we are able to solve this as soon as possible. 

    Dtyn said:
    My admin installed everything in his admin profile other than VS code that he installed as a network device.

    Not sure how installing something on network drive will work. That might be a path to pursue. 

    Have you verified that your setup is correct in the extension? (under welcome page)

    Kind regards,
    Øyvind

  • Yes, that looks correct. 

    It's strange as you are opening VS Code through the Toolchain Manager, you should have everything installed. There might be some sort of user restriction. I hope that we can help you find the answer in your new ticket

Related