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.

  • I think I got things working by updating the manifest location in .west/Config. I tried to do that with the west config command but it failed so I edited the file.

    I set the manifest to be C:\Users\z\ncs\v1.5.0\nrf.

    I've cleaned everything off my system and am trying to replicate the steps.

    There seems to be a problem with west on Windows. It complains about permission denied but that is not the real problem - permissions are fine.

  • Rather than running ncsmgr init-ncs I ran these commands from within ~/ncs/v1.5.0 to configure west:

    $ west config manifest.path nrf

    $ west config zephyr.base zephyr

    That allowed west update to work and I can build sample projects from the command line.

    I cannot build from the SEGGER IDE - I get the following failure. I'm using Jared Wolff's nRF9160 Feather board.

    Building ‘zephyr/zephyr_prebuilt.elf’ from solution ‘build’ in configuration ‘Common’
    1> Compiling ‘empty_file.c’
    1> Linking ‘zephyr_prebuilt.elf’
    1> Memory region         Used Size  Region Size  %age Used
    1>            FLASH:       19928 B     491008 B      4.06%
    1>             SRAM:        5664 B       256 KB      2.16%
    1>         IDT_LIST:          72 B         2 KB      3.52%
    Building ‘zephyr/linker_pass_final.cmd’ from solution ‘build’ in configuration ‘Common’
    1> Combining ‘zephyr/linker_pass_final.cmd’
    Building ‘zephyr/CMakeFiles/linker_pass_final_script_target’ from solution ‘build’ in configuration ‘Common’
    Building ‘zephyr/linker_pass_final_script_target’ from solution ‘build’ in configuration ‘Common’
    Building ‘zephyr/isr_tables.c’ from solution ‘build’ in configuration ‘Common’
    1> Combining ‘zephyr/isr_tables.c’
    Building ‘cmake_object_order_depends_target_zephyr_final’ from solution ‘build’ in configuration ‘Common’
    Building ‘zephyr/zephyr.elf’ from solution ‘build’ in configuration ‘Common’
    1> Compiling ‘empty_file.c’
    2> Compiling ‘isr_tables.c’
    Building ‘zephyr/zephyr.hex’ from solution ‘build’ in configuration ‘Common’
    1> Linking ‘zephyr.elf’
    1> Post-link command 
    Building ‘zephyr/mcuboot_primary_app.hex’ from solution ‘build’ in configuration ‘Common’
    1> Combining ‘zephyr/mcuboot_primary_app.hex’
    Building ‘CMakeFiles/mcuboot_primary_app_hex’ from solution ‘build’ in configuration ‘Common’
    Building ‘mcuboot_primary_app_hex’ from solution ‘build’ in configuration ‘Common’
    Building ‘zephyr/mcuboot_primary.hex’ from solution ‘build’ in configuration ‘Common’
    1> Combining ‘zephyr/mcuboot_primary.hex’
    Building ‘CMakeFiles/mcuboot_primary_hex’ from solution ‘build’ in configuration ‘Common’
    Building ‘mcuboot_primary_hex’ from solution ‘build’ in configuration ‘Common’
    Building ‘modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-mkdir’ from solution ‘build’ in configuration ‘Common’
    1> Combining ‘modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-mkdir’
    Building ‘modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-download’ from solution ‘build’ in configuration ‘Common’
    1> Combining ‘modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-download’
    Building ‘modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-update’ from solution ‘build’ in configuration ‘Common’
    1> Combining ‘modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-update’
    Building ‘modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-patch’ from solution ‘build’ in configuration ‘Common’
    1> Combining ‘modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-patch’
    Building ‘modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-configure’ from solution ‘build’ in configuration ‘Common’
    1> Combining ‘modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-configure’
    Building ‘mcuboot/zephyr/zephyr.hex’ from solution ‘build’ in configuration ‘Common’
    1> Combining ‘mcuboot/zephyr/zephyr.hex’
    1> ninja: error: mkdir(modules/mcuboot/boot/bootutil/zephyr/CMakeFiles/..__bootloader__mcuboot__boot__bootutil__zephyr.dir/C_/Users/taylod02/ncs/v1.5.0/bootloader/mcuboot/boot/bootutil/src): No such file or directory
    1> ninja: build stopped: .
    Build failed
    

    But I can edit code in the IDE and build from the command line so I can live with this.

Related