This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF Connect SDK west not working

I've tried this with both 1.5.0 and 1.5.1, with the same results.

I install the SDKs using the toolchain manager, and when the installation finishes I open a bash shell, also via the toolchain manager. Here is the output from the first time I open a shell. I've listed a few directories etc in case that's useful.

NCS repositories are not yet cloned here. To do so run the following command:

ncsmgr init-ncs

z@z MINGW64 ~/ncs/v1.5.0
$ ls -a
./  ../  .west/  nrf/  toolchain/

z@z MINGW64 ~/ncs/v1.5.0
$ ls -a nrf
./   .checkpatch.conf  .git/     .gitignore  .known-issues/  boards/  CMakeLists.txt  doc/      dts/  include/     Kconfig.nrf  LICENSE   ncs_version.h.in  samples/  share/   tests/   west.yml
../  .clang-format     .github/  .gitlint    applications/   cmake/   CODEOWNERS      drivers/  ext/  Jenkinsfile  lib/         modules/  README.rst        scripts/  subsys/  VERSION  zephyr/

z@z MINGW64 ~/ncs/v1.5.0
$ ls -a .west
./  ../  manifest-tmp/

z@z MINGW64 ~/ncs/v1.5.0
$ set | grep ZEP
ZEPHYR_BASE=C:/Users/z/ncs/v1.5.0/zephyr
ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb

z@z MINGW64 ~/ncs/v1.5.0
$ pwd
/c/Users/z/ncs/v1.5.0

z@z MINGW64 ~/ncs/v1.5.0
$ west -V
West version: v0.9.0


If I run the recommended command:

z@z MINGW64 ~/ncs/v1.5.0
$ ncsmgr init-ncs
Checking out NCS v1.5.0 ...FATAL ERROR: already initialized in C:\Users\z\ncs\v1.5.0, aborting.
Note:
    In your environment, ZEPHYR_BASE is set to:
    C:/Users/z/ncs/v1.5.0/zephyr

    This forces west to search for a workspace there.
    Try unsetting ZEPHYR_BASE and re-running this command.
HEAD is now at 8e8c6089 manifest: Update manifest file with v1.5.0 tags
/C/Users/z/ncs/v1.5.0
done
Updating repos ...
Traceback (most recent call last):
  File "C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\manifest.py", line 166, 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:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Scripts\west.exe\__main__.py", line 7, in <module>
  File "C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\app\main.py", line 779, in main
    app.run(argv or sys.argv[1:])
  File "C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\app\main.py", line 106, in run
    self.run_command(argv)
  File "C:\Users\z\ncs\v1.5.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:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\commands.py", line 129, in run
    self.do_run(args, unknown)
  File "C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\app\project.py", line 770, in do_run
    self.update_all(args)
  File "C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\app\project.py", line 787, in update_all
    self.manifest = Manifest.from_file(
  File "C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\manifest.py", line 1046, in from_file
    (mpath, mname) = _mpath(topdir=topdir)
  File "C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\manifest.py", line 171, 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')


Unsetting ZEPHYR_BASE and running gives this:

z@z MINGW64 ~/ncs/v1.5.0
$ unset  ZEPHYR_BASE

z@z MINGW64 ~/ncs/v1.5.0
$ ncsmgr init-ncs
Checking out NCS v1.5.0 ...FATAL ERROR: already initialized in C:\Users\z\ncs\v1.5.0, aborting.
HEAD is now at 8e8c6089 manifest: Update manifest file with v1.5.0 tags
/C/Users/z/ncs/v1.5.0
done
Updating repos ...
Traceback (most recent call last):
  File "C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\manifest.py", line 166, 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:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Scripts\west.exe\__main__.py", line 7, in <module>
  File "C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\app\main.py", line 779, in main
    app.run(argv or sys.argv[1:])
  File "C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\app\main.py", line 106, in run
    self.run_command(argv)
  File "C:\Users\z\ncs\v1.5.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:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\commands.py", line 129, in run
    self.do_run(args, unknown)
  File "C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\app\project.py", line 770, in do_run
    self.update_all(args)
  File "C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\app\project.py", line 787, in update_all
    self.manifest = Manifest.from_file(
  File "C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\manifest.py", line 1046, in from_file
    (mpath, mname) = _mpath(topdir=topdir)
  File "C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\Lib\site-packages\west\manifest.py", line 171, 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')

Can I build and download code without this west stuff working? If not, how do I get it working?

Regards, David.

Parents Reply Children
  • Hi Amanda,

    I don't seem to have nrfjprog:

    z@z MINGW64 ~/ncs/v1.5.0
    $ nrfjprog -v
    bash: nrfjprog: command not found
    
    z@z MINGW64 ~/ncs/v1.5.0
    $ where python
    C:\Users\z\ncs\v1.5.0\toolchain\opt\bin\python.exe
    C:\Users\z\AppData\Local\Microsoft\WindowsApps\python.exe
    
    z@z MINGW64 ~/ncs/v1.5.0
    $ python --version
    Python 3.8.2
    
    z@z MINGW64 ~/ncs/v1.5.0
    $ ls
    nrf/  toolchain/
    
    z@z MINGW64 ~/ncs/v1.5.0
    $ find . -name nrfjprog

    Thanks for the link to the manual installation, I'll try it.

    Regards, David.

  • Manual installation was no good either Disappointed

    I did try something similar yesterday when I was trying to figure out what zephyr was and had a similar error this this one.

    The command was run in a cmd.exe shell with admin rights.

    C:\Users\z>west init zephyrproject
    === Initializing in C:\Users\z\zephyrproject
    --- no --manifest-rev was given; using remote's default branch: refs/heads/master
    --- Cloning manifest repository from https://github.com/zephyrproject-rtos/zephyr, rev. refs/heads/master
    Initialized empty Git repository in C:/Users/z/zephyrproject/.west/manifest-tmp/.git/
    remote: Enumerating objects: 565785, done.
    remote: Counting objects: 100% (184/184), done.
    remote: Compressing objects: 100% (132/132), done.
    remote: Total 565785 (delta 106), reused 77 (delta 49), pack-reused 565601R
    Receiving objects: 100% (565785/565785), 385.70 MiB | 8.62 MiB/s, done.
    Resolving deltas: 100% (429322/429322), done.
    From https://github.com/zephyrproject-rtos/zephyr
     * branch            master         -> FETCH_HEAD
     * [new branch]      backport-23821-to-v1.14-branch -> origin/backport-23821-to-v1.14-branch
     * [new branch]      backport-24971-to-v1.14-branch -> origin/backport-24971-to-v1.14-branch
    ...
     * [new tag]         zephyr-v2.4.0  -> zephyr-v2.4.0
     * [new tag]         zephyr-v2.5.0  -> zephyr-v2.5.0
    Updating files: 100% (15902/15902), done.
    Note: switching to 'FETCH_HEAD'.
    
    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
    
    HEAD is now at 3a7e0f875c tests: semaphore: add k_thread_join to test_sem_take_timeout_isr
    Traceback (most recent call last):
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 806, in move
        os.rename(src, real_dst)
    PermissionError: [WinError 5] Access is denied: 'C:\\Users\\z\\zephyrproject\\.west\\manifest-tmp' -> 'C:\\Users\\z\\zephyrproject\\zephyr'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 197, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "C:\Users\z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts\west.exe\__main__.py", line 7, in <module>
      File "C:\Users\z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\west\app\main.py", line 779, in main
        app.run(argv or sys.argv[1:])
      File "C:\Users\z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\west\app\main.py", line 106, in run
        self.run_command(argv)
      File "C:\Users\z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\west\app\main.py", line 336, in run_command
        cmd.run(args, unknown, self.topdir, manifest=self.manifest)
      File "C:\Users\z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\west\commands.py", line 129, in run
        self.do_run(args, unknown)
      File "C:\Users\z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\west\app\project.py", line 198, in do_run
        topdir = self.bootstrap(args)
      File "C:\Users\z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\west\app\project.py", line 295, in bootstrap
        shutil.move(os.fspath(tempdir), os.fspath(manifest_abspath))
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 824, in move
        rmtree(src)
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 740, in rmtree
        return _rmtree_unsafe(path, onerror)
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 613, in _rmtree_unsafe
        _rmtree_unsafe(fullname, onerror)
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 613, in _rmtree_unsafe
        _rmtree_unsafe(fullname, onerror)
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 613, in _rmtree_unsafe
        _rmtree_unsafe(fullname, onerror)
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 618, in _rmtree_unsafe
        onerror(os.unlink, fullname, sys.exc_info())
      File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.1264.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 616, in _rmtree_unsafe
        os.unlink(fullname)
    PermissionError: [WinError 5] Access is denied: 'C:\\Users\\z\\zephyrproject\\.west\\manifest-tmp\\.git\\objects\\pack\\pack-53a10c3d84fae27042c4ad651e551abc34974493.idx'
    

    Here are the contents of the dirs the first error is talking about.

    C:\Users\z>cd zephyrproject
    
    C:\Users\z\zephyrproject>dir
     Volume in drive C is Windows
     Volume Serial Number is D81D-84DB
    
     Directory of C:\Users\z\zephyrproject
    
    04/05/2021  09:12 AM    <DIR>          .
    04/05/2021  09:12 AM    <DIR>          ..
    04/05/2021  09:11 AM    <DIR>          .west
    04/05/2021  09:12 AM    <DIR>          zephyr
                   0 File(s)              0 bytes
                   4 Dir(s)  345,014,820,864 bytes free
    
    C:\Users\z\zephyrproject>dir .west\manifest-tmp
     Volume in drive C is Windows
     Volume Serial Number is D81D-84DB
    
     Directory of C:\Users\z\zephyrproject\.west\manifest-tmp
    
    04/05/2021  09:13 AM    <DIR>          .
    04/05/2021  09:13 AM    <DIR>          ..
    04/05/2021  09:12 AM               291 .gitattributes
    04/05/2021  09:12 AM    <DIR>          .github
    04/05/2021  09:12 AM               673 .gitignore
    04/05/2021  09:12 AM             2,036 .gitlint
    04/05/2021  09:12 AM             1,985 .mailmap
    04/05/2021  09:12 AM             3,264 .uncrustify.cfg
    04/05/2021  09:12 AM    <DIR>          arch
    04/05/2021  09:12 AM    <DIR>          boards
    04/05/2021  09:12 AM    <DIR>          cmake
    04/05/2021  09:12 AM            62,432 CMakeLists.txt
    04/05/2021  09:12 AM            39,500 CODEOWNERS
    04/05/2021  09:12 AM             3,525 CODE_OF_CONDUCT.md
    04/05/2021  09:12 AM             1,730 CONTRIBUTING.rst
    04/05/2021  09:12 AM    <DIR>          doc
    04/05/2021  09:12 AM    <DIR>          drivers
    04/05/2021  09:12 AM    <DIR>          dts
    04/05/2021  09:12 AM    <DIR>          include
    04/05/2021  09:12 AM               195 Kconfig
    04/05/2021  09:12 AM            19,637 Kconfig.zephyr
    04/05/2021  09:12 AM    <DIR>          kernel
    04/05/2021  09:12 AM    <DIR>          lib
    04/05/2021  09:12 AM            11,560 LICENSE
    04/05/2021  09:12 AM            35,236 MAINTAINERS.yml
    04/05/2021  09:12 AM    <DIR>          misc
    04/05/2021  09:12 AM    <DIR>          modules
    04/05/2021  09:12 AM             4,057 README.rst
    04/05/2021  09:12 AM    <DIR>          samples
    04/05/2021  09:12 AM    <DIR>          scripts
    04/05/2021  09:12 AM    <DIR>          share
    04/05/2021  09:12 AM    <DIR>          soc
    04/05/2021  09:12 AM    <DIR>          subsys
    04/05/2021  09:12 AM    <DIR>          tests
    04/05/2021  09:12 AM                90 VERSION
    04/05/2021  09:12 AM               595 version.h.in
    04/05/2021  09:12 AM             5,855 west.yml
    04/05/2021  09:12 AM               116 zephyr-env.cmd
    04/05/2021  09:12 AM             2,122 zephyr-env.sh
                  19 File(s)        194,899 bytes
                  20 Dir(s)  345,012,654,080 bytes free
    
    C:\Users\z\zephyrproject>dir zephyr
     Volume in drive C is Windows
     Volume Serial Number is D81D-84DB
    
     Directory of C:\Users\z\zephyrproject\zephyr
    
    04/05/2021  09:12 AM    <DIR>          .
    04/05/2021  09:12 AM    <DIR>          ..
    04/05/2021  09:12 AM    <DIR>          .buildkite
    04/05/2021  09:12 AM               783 .checkpatch.conf
    04/05/2021  09:12 AM             4,818 .clang-format
    04/05/2021  09:12 AM               475 .codecov.yml
    04/05/2021  09:12 AM             1,073 .editorconfig
    04/05/2021  09:12 AM    <DIR>          .git
    04/05/2021  09:12 AM               291 .gitattributes
    04/05/2021  09:12 AM    <DIR>          .github
    04/05/2021  09:12 AM               673 .gitignore
    04/05/2021  09:12 AM             2,036 .gitlint
    04/05/2021  09:12 AM             1,985 .mailmap
    04/05/2021  09:12 AM             3,264 .uncrustify.cfg
    04/05/2021  09:12 AM    <DIR>          arch
    04/05/2021  09:12 AM    <DIR>          boards
    04/05/2021  09:12 AM    <DIR>          cmake
    04/05/2021  09:12 AM            62,432 CMakeLists.txt
    04/05/2021  09:12 AM            39,500 CODEOWNERS
    04/05/2021  09:12 AM             3,525 CODE_OF_CONDUCT.md
    04/05/2021  09:12 AM             1,730 CONTRIBUTING.rst
    04/05/2021  09:12 AM    <DIR>          doc
    04/05/2021  09:12 AM    <DIR>          drivers
    04/05/2021  09:12 AM    <DIR>          dts
    04/05/2021  09:12 AM    <DIR>          include
    04/05/2021  09:12 AM               195 Kconfig
    04/05/2021  09:12 AM            19,637 Kconfig.zephyr
    04/05/2021  09:12 AM    <DIR>          kernel
    04/05/2021  09:12 AM    <DIR>          lib
    04/05/2021  09:12 AM            11,560 LICENSE
    04/05/2021  09:12 AM            35,236 MAINTAINERS.yml
    04/05/2021  09:12 AM    <DIR>          misc
    04/05/2021  09:12 AM    <DIR>          modules
    04/05/2021  09:12 AM             4,057 README.rst
    04/05/2021  09:12 AM    <DIR>          samples
    04/05/2021  09:12 AM    <DIR>          scripts
    04/05/2021  09:12 AM    <DIR>          share
    04/05/2021  09:12 AM    <DIR>          soc
    04/05/2021  09:12 AM    <DIR>          subsys
    04/05/2021  09:12 AM    <DIR>          tests
    04/05/2021  09:12 AM                90 VERSION
    04/05/2021  09:12 AM               595 version.h.in
    04/05/2021  09:12 AM             5,855 west.yml
    04/05/2021  09:12 AM               116 zephyr-env.cmd
    04/05/2021  09:12 AM             2,122 zephyr-env.sh
                  23 File(s)        202,048 bytes
                  22 Dir(s)  345,012,654,080 bytes free
    			  

    Regards, David.

  • Hi David, 

    Can you follow the step in Installing the nRF Connect SDK manually doc?

    I think you already have nrf/  and toolchain/ under ncs/v1.5.0., then you can open bash or command prompt from the toolchain manager to enter the following command to clone the project repositories:

    west update

    Export a Zephyr CMake package. This allows CMake to automatically load the boilerplate code required for building nRF Connect SDK applications:

    west zephyr-export

    Does your directory structure look similar to the following?

    ncs
     |___ .west
     |___ bootloader
     |___ modules
     |___ nrf
     |___ nrfxlib
     |___ zephyr
     |___ ...

    If these cannot help, please provide the log. Thanks. 

    -Amanda H.

Related