Toolchain bash prompt in NCS v2.0.0

I would like to be able to open a bash prompt with the nRF Connect SDK (NCS) v2.0.0 toolchain environment loaded without going through Toolchain Manager ("open bash" option).

Using NCS v1.9.1, I would run "git-bash.exe" located in the "v1.9.1/toolchain" folder. A bash prompt would open, the current directory would be the root NCS v1.9.1 folder, and I could run west commands just fin.

Using NCS v2.0.0, I run "git-bash.exe" located in the "toolchains/v2.0.0" folder. A bash prompt opens, but the current directory is "/" (the "toolchains/v2.0.0" folder) and when I run west, I get a "command not found" error. I also tried running "git-cmd.exe", which opens a command prompt, but again west is not recognized as a command.

For NCS v2.0.0, using Toolchain Manager to open bash or open command prompt works just fine.

Any suggestions? Is this a defect in NCS v2.0.0?

Thanks!

Parents Reply Children
  • Ah, sorry - I forgot that you were using bash before writing the answer. For cmd you can do as I suggested. With bash, you just need to set the path to ZEPHYR_BASE. For instance, on my PC that would be:

    export ZEPHYR_BASE=/c/Users/eith/src/tcm_ncs/v2.0.0/zephyr/

  • Unfortunately that did not work either. I opened a prompt using "git-bash.exe" and then ran

    export ZEPHYR_BASE=/c/Users/abkirchhoff/NordicSdk/v2.0.0/zephyr/

    I also ran 

    source /c/Users/abkirchhoff/NordicSdk/v2.0.0/zephyr/zephyr-env.sh

    After both steps, attempting to run west resulted in a "command not found" error.

    I believe there may be PATH or other environment variables not being set up correctly. These may be hard to chase down and may have a more complicated workaround than just using Toolchain Manager to launch the bash prompt. So I'll just wait for that next release of Toolchain Manager. :-)

    Thanks for your help!

  • I'm not 100% sure this is still the case, but with previous versions I had a build set up where I used a custom ZEPHYR_BASE, ZEPHYR_TOOLCHAIN_VARIANT and GNUARMEMB_TOOLCHAIN_PATH. The only way this worked was if I also appended the following to the end of the west build command. Worth a try?

    -- -DNCS_TOOLCHAIN_VERSION=NONE
  • I did not specify, but did you start the terminal from the toolchain manager? That is always required, and is a pre-requisite for what I described in my previous post:

  • Einar,

    The point of my original post was that I would like to start a bash prompt that loads the correct Zephyr/west environment WITHOUT using Toolchain Manager. This was possible in NCS v1.9.1 by running "git-bash.exe", but this does not work in v2.0.0.

    After running "git-bash.exe in NCS v1.9.1:

    abkirchhoff@xxxxIND MINGW64 ~/NordicSdk/v1.9.1
    $ west -V
    West version: v0.12.0

    After running "git-bash.exe in NCS v2.0.0:

    abkirchhoff@xxxxIND MINGW64 /
    $ west -V
    bash: west: command not found

    Hopefully, that clarifies the issue. If an update to NCS and/or Toolchain Manager is required, that is fine, but if you have a workaround, that would be great! Using Toolchain Manager to open the bash prompt works fine, but I don't know how to re-create what it is doing to load the correct environment for the bash prompt. 

Related