nRF Connect: How to build from command line after doing automatic install

I followed the instructions to install the nRF Connect SDK using the automatic method:

http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/gs_assistant.html

That worked and I was able to build sample applications and run them on the DK. Now I would also like the ability to build from the command line. The instructions say you need to start a new shell from the toolchain manager. This also works. However I cannot build from the shell if I start the shell without using the toolchain manager. How can I do that?

It seems my build problems are fixed if I set the environment variable ZEPHYR_SDK_INSTALL_DIR. I noticed this variable is set when I start my shell from the Toolchain Manager but it is not set when I launch a shell normally. 

ZEPHYR_SDK_INSTALL_DIR=/opt/nordic/ncs/toolchains/v2.1.0/opt/zephyr-sdk

So.. If I start a regular shell (without using toolchain manager) and set this variable the builds are working. Is this a valid way to use the SDK? 

Parents Reply Children
  • When using docker with sdk 2.5.1 I found the execution of single unit tests via west build no longer worked. Changing to the right folder was no longer possible as the launching of a shell via the entry point meant I would either have a shell with environment that did not handle the commands, or a shell without the environment that would.

    Using the nrfutil command Peter posted allowed preparing the shell and then west build could run the specific unit tests again. The big question is, what is the intended way of running a single test seeing how this seems like a workaround?

Related