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 D. 

    This is a strange behavior.  

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

    Did you try this within the Command Prompt or Git bash from the Toolchain Manager dropdown menu? 

    Kind regards,
    Øyvind

  • A small correction, open Command prompt or git bash from the Toolchain Manager and try running 

    ncsmgr init-ncs
  • Hello Øyvind,

    Yes, I tried but it fails:

    501@c-DF0V MINGW64 /c/nordic/myapps/lpuart-test
    $ west init
    FATAL ERROR: already initialized in C:\nordic\ncs\v1.9.1, aborting.
    Note:
    In your environment, ZEPHYR_BASE is set to:
    C:/nordic/ncs/v1.9.1/zephyr

    This forces west to search for a workspace there.
    Try unsetting ZEPHYR_BASE and re-running this command.

    I also tried unsetting ZEPHYR_BASE as it recommended. I unset it in the terminal window. Then west init worked and completed Ok. I opened VS Code again, but the problem is still there. I also tried updating the Quick Configuration - set the SDK to be the one that west init downloaded in my sample application folder. Still the same error.

    What else can I try?

    Yesterday, I also tried removing everything (SDK and all supporting software that I installed), including cleaning all user directories that were created. Then re-installing again. No luck - the error is still there.

    Thank you,

    D.

  • I tried it - from the Toolchain Manager, I opened Bash window and then I executed ncsmgr init-ncs:

    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.9.1
    $ ncsmgr init-ncs
    Checking out NCS v1.9.1 ...FATAL ERROR: already initialized in C:\nordic\ncs\v1.9.1, aborting.
    Note:
    In your environment, ZEPHYR_BASE is set to:
    C:/nordic/ncs/v1.9.1/zephyr

    This forces west to search for a workspace there.
    Try unsetting ZEPHYR_BASE and re-running this command.
    HEAD is now at 126fad0e2 manifest: update manifest file with 1.9.1 tags
    /C/nordic/ncs/v1.9.1
    done
    Updating repos ...
    done
    usage: west [-h] [-z ZEPHYR_BASE] [-v] [-V] <command> ...

    It is says that the NCS repositories are not cloned yet, but after I tried to run init-ncs it says that is is already initialized?!

  • Thanks for testing. Could you please try to run the following command in the VS Code Command Palette: nrf Connect: Generate Support Information and provide the information here as a .txt file or using Insert --> Code.

Related