Unable to build sample application on Windows

Hi,

I installed nRF Connect SDK (1.9.1) using Toolchain Manager v0.10.3, and nRF Connect for Desktop v3.11.0. Before that I also installed NRF command line tools 10.15.4.

My OS is Windows 10.

I installed VS Code 1.67.0 and all extensions that the Toolchain Manager recommended. The extensions were installed from within the Toolchain manager.

All this is a new install. I never used the Nordic SDK before.

I installed the SDK in c:\nordic\ncs

In VSCode, I performed the quick setup:

After that I created a Freestanding application from a sample. The application location is c:\nordic\myapps and the application name is lpuart-test. The application was created Ok. 

But when I tried to create build configuration and build it, the build step fails with this error:

> Executing task: nRF Connect: Generate config nrf52833dongle_nrf52833 for c:\nordic\myapps\lpuart-test <

Building lpuart-test
west build --build-dir c:\nordic\myapps\lpuart-test\build c:\nordic\myapps\lpuart-test --pristine --board nrf52833dongle_nrf52833 -- -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_DEBUG_THREAD_INFO=y -DBOARD_ROOT:STRING="c:/nordic/myapps/lpuart-test"

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.

 

This seems to be exactly the same problem as mentioned here (for OS X):

devzone.nordicsemi.com/.../can-t-build-example-application-in-visual-studio-code-osx

That post mentions about invoking "west init". I tried to invoke west, but it complains the Python is not found.

What do I need to do in order to resolve the above? I just want to build one the provided sample applications.

Thank you,

D.

  • Hello Øyvind,

    Here is the support information from:

    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 https://devzone.nordicsemi.com/.
    
    {
      "platform": {
        "os": "win32",
        "osVersion": "Windows 10 Enterprise",
        "osKernel": "10.0.18363",
        "vscode": "1.67.1",
        "electron": "17.4.1",
        "node": "v16.13.0"
      },
      "system": {
        "date": "2022-05-11T15:33:44.843Z",
        "vscodeRoot": "c:\\Users\\501\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "01:56:53",
        "osUptime": "52:43:42",
        "cpu": {
          "model": "Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz",
          "speed": "2712 MHz",
          "count": 6
        },
        "memory": {
          "total": "31.61 GB",
          "free": "14.89 GB"
        }
      },
      "workspace": {
        "name": "Untitled (Workspace)",
        "workspaceFile": "1652214473107",
        "folders": [
          "c:\\nordic\\myapps\\lpuart-test"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2022.4.219",
            "path": "c:\\Users\\501\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2022.4.219",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2022.4.61",
            "path": "c:\\Users\\501\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2022.4.61",
            "isActive": true
          },
          "nordic-semiconductor.devicetree": null,
          "nordic-semiconductor.kconfig": null
        },
        "external": {
          "marus25.cortex-debug": "1.4.4",
          "ms-vscode.cpptools": "1.9.8",
          "ms-vscode-remote.remote-wsl-recommender": "0.0.15",
          "ms-vscode.js-debug": "1.67.2",
          "ms-vscode.js-debug-companion": "1.0.18",
          "ms-vscode.references-view": "0.0.89",
          "ms-vscode.vscode-js-profile-table": "1.0.1",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "C:\\Program Files (x86)\\SEGGER\\JLink_V758b\\JLink.exe": "7.58b",
        "C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.15.4",
        "nrfutil": "Not found",
        "c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin\\cmake.exe": "3.20.5",
        "c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Scripts\\west.exe": "0.12.0",
        "c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin\\python.exe": "3.8.2",
        "c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin\\ninja.exe": "1.9.0",
        "c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin\\gperf.exe": "3.1",
        "c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin\\dtc.exe": "1.4.7",
        "c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin\\arm-none-eabi-gcc.exe": "9-2019-q4-major",
        "c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin\\gn.exe": "1977",
        "c:\\nordic\\ncs\\v1.9.1\\toolchain\\mingw64\\bin\\git.exe": "2.26.2.windows.1"
      },
      "sdks": [],
      "toolchains": [
        {
          "version": "1.9.1",
          "path": "c:\\nordic\\ncs\\v1.9.1\\toolchain"
        }
      ],
      "connectedDevices": [],
      "deviceProviders": [
        "nrfjprog"
      ],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "c:\\nordic\\ncs\\v1.9.1",
          "toolchain": {
            "path": "${nrf-connect.toolchain:1.9.1}"
          },
          "ozonePath": "",
          "applications": [
            "${workspaceFolder}"
          ],
          "applicationOptions": {},
          "kconfig": {
            "interface": "kconfig"
          },
          "welcome": {
            "showOnStartup": true
          },
          "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,
          "showRTOS": false,
          "showDevDebugOutput": "none"
        }
      },
      "environment": {
        "westExe": "c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Scripts\\west.exe",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\501",
          "HOMEDRIVE": "H:",
          "HOMEPATH": "\\",
          "Path": "c:\\nordic\\ncs\\v1.9.1\\toolchain\\mingw64\\bin;c:\\nordic\\ncs\\v1.9.1\\toolchain\\mingw64\\libexec\\git-core;c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin;c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Scripts;C:\\Program Files\\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\\Microsoft SQL Server\\130\\Tools\\Binn\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\170\\Tools\\Binn\\;C:\\Strawberry\\c\\bin;C:\\Strawberry\\perl\\site\\bin;C:\\Strawberry\\perl\\bin;C:\\Users\\501\\.dnx\\bin;C:\\Program Files\\Microsoft DNX\\Dnvm\\;C;C:\\Program Files\\dotnet\\;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\501\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\501\\.dotnet\\tools;C:\\Users\\501\\AppData\\Local\\Programs\\Microsoft VS Code\\bin",
          "ZEPHYR_BASE": "c:\\nordic\\ncs\\v1.9.1\\zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "PYTHONPATH": "c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin;c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Lib;c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin\\Lib\\site-packages",
          "Python3_ROOT": "c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin"
        },
        "toolchainPath": "c:\\nordic\\ncs\\v1.9.1\\toolchain",
        "toolchainBinPath": "c:\\nordic\\ncs\\v1.9.1\\toolchain\\opt\\bin",
        "toolchainVersion": "1.9.1"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }
    
    

  • Thanks for providing this information. I'm not able to see any reason for why this should fail. Do you have any anti-virus running or similar? Is this a corporate computer with any limits on your user? Asking to verify that nothing is blocked. 

    Comparing to my output, there isn't many differences that I can see in regards to the environment. 

    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 https://devzone.nordicsemi.com/.
    
    {
      "platform": {
        "os": "win32",
        "osVersion": "Windows 10 Enterprise",
        "osKernel": "10.0.19044",
        "vscode": "1.67.1",
        "electron": "17.4.1",
        "node": "v16.13.0"
      },
      "system": {
        "date": "2022-05-11T15:43:56.952Z",
        "vscodeRoot": "c:\\Users\\username\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "01:53:29",
        "osUptime": "55:26:55",
        "cpu": {
          "model": "Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz",
          "speed": "2112 MHz",
          "count": 4
        },
        "memory": {
          "total": "15.88 GB",
          "free": "4.35 GB"
        }
      },
      "workspace": {
        "name": "Untitled (Workspace)",
        "workspaceFile": "1652272110960",
        "folders": [
          "c:\\NordicSemi\\v1.9.1",
          "c:\\Temp\\Projects\\lpuart",
          "c:\\Temp\\Projects\\application_update",
          "c:\\Temp\\Projects\\at_client"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2022.4.219",
            "path": "c:\\Users\\username\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2022.4.219",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2022.4.61",
            "path": "c:\\Users\\username\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2022.4.61",
            "isActive": true
          },
          "nordic-semiconductor.devicetree": null,
          "nordic-semiconductor.kconfig": null
        },
        "external": {
          "marus25.cortex-debug": "1.4.4",
          "ms-vscode.cpptools": "1.9.8",
          "ms-vscode-remote.remote-wsl-recommender": "0.0.15",
          "ms-vscode.js-debug": "1.67.2",
          "ms-vscode.js-debug-companion": "1.0.18",
          "ms-vscode.references-view": "0.0.89",
          "ms-vscode.vscode-js-profile-table": "1.0.1",
          "eamodio.gitlens": "12.0.6",
          "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.0",
        "C:\\Python39\\Scripts\\nrfutil.exe": null,
        "c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\cmake.exe": "3.20.5",
        "c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\Scripts\\west.exe": "0.12.0",
        "c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\python.exe": "3.8.2",
        "c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\ninja.exe": "1.9.0",
        "c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\gperf.exe": "3.1",
        "c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\dtc.exe": "1.4.7",
        "c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\arm-none-eabi-gcc.exe": "9-2019-q4-major",
        "c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\gn.exe": "1977",
        "c:\\NordicSemi\\v1.9.1\\toolchain\\mingw64\\bin\\git.exe": "2.26.2.windows.1"
      },
      "sdks": [
        {
          "version": "1.9.99-dev1",
          "path": "c:\\NordicSemi\\NCS"
        },
        {
          "version": "1.7.0",
          "path": "c:\\NordicSemi\\v1.7.0"
        },
        {
          "version": "1.7.1",
          "path": "c:\\NordicSemi\\v1.7.1"
        },
        {
          "version": "1.5.0",
          "path": "c:\\NordicSemi\\v1.5.0"
        },
        {
          "version": "1.9.0",
          "path": "c:\\NordicSemi\\v1.9.0"
        },
        {
          "version": "1.9.1",
          "path": "c:\\NordicSemi\\v1.9.1"
        }
      ],
      "toolchains": [
        {
          "version": "1.7.0",
          "path": "c:\\NordicSemi\\v1.7.0\\toolchain"
        },
        {
          "version": "1.7.1",
          "path": "c:\\NordicSemi\\v1.7.1\\toolchain"
        },
        {
          "version": "1.5.0",
          "path": "c:\\NordicSemi\\v1.5.0\\toolchain"
        },
        {
          "version": "1.9.0",
          "path": "c:\\NordicSemi\\v1.9.0\\toolchain"
        },
        {
          "version": "1.9.1",
          "path": "c:\\NordicSemi\\v1.9.1\\toolchain"
        }
      ],
      "connectedDevices": [
        {
          "serialNumber": "960008922"
        }
      ],
      "deviceProviders": [
        "nrfjprog"
      ],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:1.9.1}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:1.9.1}"
          },
          "ozonePath": "",
          "applications": [
            "c:\\Temp\\Projects\\hello_matter",
            "c:\\Temp\\Projects\\lpuart",
            "c:\\Temp\\Projects\\application_update",
            "c:\\Temp\\Projects\\at_client"
          ],
          "applicationOptions": {},
          "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,
          "showRTOS": false,
          "showDevDebugOutput": "none"
        }
      },
      "environment": {
        "westExe": "c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\Scripts\\west.exe",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "C:\\Users\\username",
          "HOMEDRIVE": "C:",
          "HOMEPATH": "\\Users\\username",
          "Path": "c:\\NordicSemi\\v1.9.1\\toolchain\\mingw64\\bin;c:\\NordicSemi\\v1.9.1\\toolchain\\mingw64\\libexec\\git-core;c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin;c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\Scripts;C:\\Python39\\Scripts\\;C:\\Python39\\;c:\\Program Files\\CMake\\bin\\;c:\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Mosquitto;C:\\Program Files\\CMake\\bin;C:\\Program Files (x86)\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Work\\30 Support\\06 Software\\nrfutil.exe;C:\\Program Files\\PuTTY\\;C:\\Program Files\\dotnet\\;C:\\gnuarmemb\\bin;C:\\Cmder\\bin;C:\\Cmder\\vendor\\bin;C:\\Cmder\\vendor\\conemu-maximus5\\ConEmu\\Scripts;C:\\Cmder\\vendor\\conemu-maximus5;C:\\Cmder\\vendor\\conemu-maximus5\\ConEmu;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;c:\\Program Files\\CMake\\bin\\;c:\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\PuTTY\\;C:\\Program Files\\LLVM\\bin;C:\\Program Files\\CMake\\bin;C:\\Go\\bin;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Users\\username\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\username\\zephyrrc.cmd;C:\\Users\\username\\go\\bin;C:\\Program Files\\Git\\mingw64\\bin;C:\\Program Files\\Git\\usr\\bin;C:\\Cmder;C:\\Program Files\\Mosquitto;C:\\Program Files (x86)\\SEGGER\\JLink;C:\\Users\\username\\AppData\\Local\\Microsoft\\WindowsApps;C:\\NordicSemi\\GN\\gn;C:\\Users\\username\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Work\\30 Support\\06 Software\\nrfutil.exe",
          "ZEPHYR_BASE": "c:\\NordicSemi\\v1.9.1\\zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "c:\\NordicSemi\\v1.9.1\\toolchain\\opt",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "PYTHONPATH": "c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin;c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\Lib;c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin\\Lib\\site-packages",
          "Python3_ROOT": "c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin"
        },
        "toolchainPath": "c:\\NordicSemi\\v1.9.1\\toolchain",
        "toolchainBinPath": "c:\\NordicSemi\\v1.9.1\\toolchain\\opt\\bin",
        "toolchainVersion": "1.9.1"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }
    
    

  • Yes, the machine is a company PC and it does have anti-virus running. I have admin rights. During the installation, everything seemed to install Ok - no errors, no admin escalation requests.

    I see that in your configuration there are few differences compared to mine:

    - under workspace -> folders, it looks like the SDK is listed there, while in mine it is not

    - your sdks element is populated mine is empty

    - your configuration has (what looks like env. variable) "${nrf-connect.sdk} while mine does not have such variable

    - in my configuration HOMEDRIVE is set to H: - but I do not have this drive available at the moment

    I do not know if any of these maybe the issue.

    I use this machine for all my development work, and I have not had any issues.

  • Hello Øyvind,

    I was able to get it to work.

    It looks like there is some type of race condition, probably between west and git. I used SDK 1.7.0, because it prints out more information while installing.

    Here is the output when running ncsmgr init-ncs, from a Bash prompt:

    NCS repositories are not yet cloned here. To do so run the following command:
    
    ncsmgr init-ncs
    
    501@c-DF0V MINGW64 /c/nordic/ncs/v1.7.0
    $ ncsmgr init-ncs
    Checking out NCS v1.7.0 ...=== Initializing in C:\nordic\ncs\v1.7.0
    --- Cloning manifest repository from https://github.com/nrfconnect/sdk-nrf, rev. v1.7.0
    Cloning into 'C:\nordic\ncs\v1.7.0\.west\manifest-tmp'...
    remote: Enumerating objects: 114292, done.
    remote: Counting objects: 100% (86/86), done.
    remote: Compressing objects: 100% (62/62), done.
    remote: Total 114292 (delta 31), reused 46 (delta 23), pack-reused 114206
    Receiving objects: 100% (114292/114292), 65.74 MiB | 6.44 MiB/s, done.
    Resolving deltas: 100% (84710/84710), done.
    Note: switching to 'd29f1ddec99b81a66af93b7f0882a7bd0dfa30ee'.
    
    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by switching back to a branch.
    
    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -c with the switch command. Example:
    
      git switch -c <new-branch-name>
    
    Or undo this operation with:
    
      git switch -
    
    Turn off this advice by setting config variable advice.detachedHead to false
    
    Updating files: 100% (4788/4788), done.
    Traceback (most recent call last):
      File "shutil.py", line 788, in move
    PermissionError: [WinError 5] Access is denied: 'C:\\nordic\\ncs\\v1.7.0\\.west\\manifest-tmp' -> 'C:\\nordic\\ncs\\v1.7.0\\nrf'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "runpy.py", line 193, in _run_module_as_main
      File "runpy.py", line 86, in _run_code
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Scripts\west.exe\__main__.py", line 7, in <module>
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\app\main.py", line 779, in main
        app.run(argv or sys.argv[1:])
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\app\main.py", line 106, in run
        self.run_command(argv)
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\app\main.py", line 336, in run_command
        cmd.run(args, unknown, self.topdir, manifest=self.manifest)
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\commands.py", line 132, in run
        self.do_run(args, unknown)
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\app\project.py", line 198, in do_run
        topdir = self.bootstrap(args)
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\app\project.py", line 305, in bootstrap
        shutil.move(os.fspath(tempdir), os.fspath(manifest_abspath))
      File "shutil.py", line 800, in move
      File "shutil.py", line 737, in rmtree
      File "shutil.py", line 610, in _rmtree_unsafe
      File "shutil.py", line 610, in _rmtree_unsafe
      File "shutil.py", line 610, in _rmtree_unsafe
      File "shutil.py", line 615, in _rmtree_unsafe
      File "shutil.py", line 613, in _rmtree_unsafe
    PermissionError: [WinError 5] Access is denied: 'C:\\nordic\\ncs\\v1.7.0\\.west\\manifest-tmp\\.git\\objects\\pack\\pack-7e558cb519128fd6fa01f63f6a7fb2fc16c13469.idx'
    HEAD is now at d29f1ddec ncs: v1.7.0
    /C/nordic/ncs/v1.7.0
    done
    Updating repos ...
    Traceback (most recent call last):
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\manifest.py", line 172, in _mpath
        path = cp.get('manifest', 'path')
      File "configparser.py", line 781, in get
      File "configparser.py", line 1149, in _unify_values
    configparser.NoSectionError: No section: 'manifest'
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "runpy.py", line 193, in _run_module_as_main
      File "runpy.py", line 86, in _run_code
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Scripts\west.exe\__main__.py", line 7, in <module>
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\app\main.py", line 779, in main
        app.run(argv or sys.argv[1:])
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\app\main.py", line 106, in run
        self.run_command(argv)
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\app\main.py", line 336, in run_command
        cmd.run(args, unknown, self.topdir, manifest=self.manifest)
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\commands.py", line 132, in run
        self.do_run(args, unknown)
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\app\project.py", line 801, in do_run
        self.update_all()
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\app\project.py", line 855, in update_all
        self.manifest = Manifest.from_file(
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\manifest.py", line 1104, in from_file
        (mpath, mname) = _mpath(topdir=topdir)
      File "C:\nordic\ncs\v1.7.0\toolchain\opt\bin\Lib\site-packages\west\manifest.py", line 177, in _mpath
        raise MalformedConfig('no "manifest.path" config option is set') from e
    west.manifest.MalformedConfig: no "manifest.path" config option is set
    done
    usage: west [-h] [-z ZEPHYR_BASE] [-v] [-V] <command> ...
    west: error: argument <command>: invalid choice: 'zephyr-export' (choose from 'init', 'update', 'list', 'manifest', 'diff', 'status', 'forall', 'help', 'config', 'topdir', 'selfupdate')
    
    

     

    See line 63:

    PermissionError: [WinError 5] Access is denied: 'C:\\nordic\\ncs\\v1.7.0\\.west\\manifest-tmp\\.git\\objects\\pack\\pack-7e558cb519128fd6fa01f63f6a7fb2fc16c13469.idx'

    My Windows user has full control of the entire c:\nordic tree. No other process is accessing that directory tree.

    If I add 3 seconds delay in ncsmgr_init-ncs.sh, like this:

    pushd "${baseDir}/.." >/dev/null
    
    log -n "Checking out NCS ${ncs_tag} ..."
    
    if [ "$1" = "--just-update" ]; then
        cd nrf
        git fetch origin
    else
        west init -m https://github.com/nrfconnect/sdk-nrf --mr "${ncs_tag}"
        cd nrf
    fi
    
    sleep 3
    
    git checkout "${ncs_tag}"
    cd -

    everything works Ok. Here is the output (I interrupted it when it started cloning zephyr - if I left it it would continue and clone all NCS remaining repositories):

    501@c-DF0V MINGW64 /c/nordic/ncs/v1.7.0
    $ ncsmgr init-ncs
    Checking out NCS v1.7.0 ...=== Initializing in C:\nordic\ncs\v1.7.0
    --- Cloning manifest repository from https://github.com/nrfconnect/sdk-nrf, rev. v1.7.0
    Cloning into 'C:\nordic\ncs\v1.7.0\.west\manifest-tmp'...
    remote: Enumerating objects: 114292, done.
    remote: Counting objects: 100% (86/86), done.
    remote: Compressing objects: 100% (63/63), done.
    remote: Total 114292 (delta 31), reused 44 (delta 22), pack-reused 114206
    Receiving objects: 100% (114292/114292), 65.72 MiB | 6.85 MiB/s, done.
    Resolving deltas: 100% (84732/84732), done.
    Note: switching to 'd29f1ddec99b81a66af93b7f0882a7bd0dfa30ee'.
    
    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by switching back to a branch.
    
    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -c with the switch command. Example:
    
      git switch -c <new-branch-name>
    
    Or undo this operation with:
    
      git switch -
    
    Turn off this advice by setting config variable advice.detachedHead to false
    
    Updating files: 100% (4788/4788), done.
    --- setting manifest.path to nrf
    === Initialized. Now run "west update" inside C:\nordic\ncs\v1.7.0.
    HEAD is now at d29f1ddec ncs: v1.7.0
    /C/nordic/ncs/v1.7.0
    done
    Updating repos ...
    === updating zephyr (zephyr):
    --- zephyr: initializing
    Initialized empty Git repository in C:/nordic/ncs/v1.7.0/zephyr/.git/
    --- zephyr: fetching, need revision v2.6.99-ncs1
    remote: Enumerating objects: 643744, done.

    By adding sleep 3, I was able to install SDK 1.9.1. Without the sleep 3, SDK 1.9.1 does not print any errors, even though it fails to install. It would be good if at least the install process does not silently ignore the error so the user can see that something failed, right away.

  • Thanks for testing and you valuable feedback! This is most likely due to the anti-virus causing the issue. Another customer saw the same issue here.

Related