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.

Parents
  • 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.

Reply Children
No Data
Related