west build is invalid choice

Hi,

I have installed the nRF Connect SDK v2.0.0 with Visual Studio and can now successfully, build, flash and run the nrf9160 at_client sample application. But when I try to build it from the command line west says that 'build' is an invalid choice. When building from the command line, I select "Open Terminal" from the nRF Connect SDK line in the toolchain manager. Then when I try to build, I get this:

at_client [master●] % west build -b nrf9160dk_nrf9160_ns
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')
Any ideas why this is happening?
Thanks
Greg
Parents
  • Solved it. If I run:

        export ZEPHYR_BASE=/opt/nordic/ncs/v2.0.0/zephyr

    and then run west build it works. Interesting, if I try to specify the ZEPHYR_BASE on the west command line with -z it does not work. Anyway, I would think that the ZEPHYR_BASE would have been set up by the Open Terminal command.

  • Ah ok,

    I think your exporting of $ZEPHYR_BASE probably informs `west` of the path needed to get to /opt/nordic/ncs/v2.0.0/zephyr/scripts/zephyr_module.py. I'm guessing such a script exists on your system.

    I'm not proficient in Python, but it looks like this script may be the entry point for `west` to obtain its build related extending commands, the one that was not available when you tried earlier from the nRF Connect terminal window.

    If you are good compiling and working in the arbitrary location then you're home!  If you need to version control your work, you may be faced with making the sample copy a fully stand alone Zephyr application.

    Glad to hear you have gotten things running as quickly!

    - Ted

Reply
  • Ah ok,

    I think your exporting of $ZEPHYR_BASE probably informs `west` of the path needed to get to /opt/nordic/ncs/v2.0.0/zephyr/scripts/zephyr_module.py. I'm guessing such a script exists on your system.

    I'm not proficient in Python, but it looks like this script may be the entry point for `west` to obtain its build related extending commands, the one that was not available when you tried earlier from the nRF Connect terminal window.

    If you are good compiling and working in the arbitrary location then you're home!  If you need to version control your work, you may be faced with making the sample copy a fully stand alone Zephyr application.

    Glad to hear you have gotten things running as quickly!

    - Ted

Children
No Data
Related