This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

entering command-line environment

Hi,

I've installed the nRF Connect SDK, and want to bring up a command-line build environment.

I'm able to do it as it says in the instructions here: Bring up the Toolchain Manager and use the "Open Bash" option from the drop-down menu.

However, I'd like to be able to get into the environment without bringing up the Toolchain Manager. What do I do? What script do I run from git-bash?

I tried running zephyr/zephyr-env.sh, but apparently that's not enough.

Thanks!

  • Hi,

    Thanks - your reply helped me to find the solution.
    tl;dr: I should launch Git bash by running the git-bash.exe executable in the SDK's toolchain dir, not my "regular" Git bash, and everything will be set up automagically.

    Git Bash:

    The root dir (the "/" dir) in Git Bash is: The directory of the git-bash.exe executable that was launched.

    When I launch Git bash on my system the "normal" way, it launches my regular git-bash.exe executable from C:\Program Files\Git - and so that is root.

    The Toolchain Manager, otoh, uses the git-bash.exe executable in the SDK's toolchain dir - and so that is root.

    Next, Git bash executes /etc/profile (off of whatever root is). The SDK's /etc/profile executes everything in the profile.d subdir. In particular, profile.d/ncs-env.sh sets up the proper SDK environment.

    So, if I execute the git-bash.exe executable in the SDK's toolchain dir, I don't need to do anything else.

    Windows Command Shell:

    To launch the Windows Command Shell, the Toolchain Manager executes the git-cmd.cmd script in the SDK's toolchain dir. All this script does, really, is execute cmd\env.cmd. Simply bringing up the "regular" Windows command shell and running either git-cmd.cmd or cmd\env.cmd accomplishes the same thing - which is why what I did previously with the Windows command shell worked.

    Windows Power Shell:

    The SDK does not have a pre-packaged way to bring up a Windows Power Shell environment, so, I will not use it.

    Hope this helps Wink

    Thanks!

  • The solution in the suggested answer to simply run "git-bash.exe" in the toolchain folder works great for SDK v1.9.1. However, for SDK v2.0.0, the git-bash.exe file was moved to a separate "toolchains/v2.0.0" folder and running "git-bash.exe" in this folder does not load the correct environment. Any suggestions?

    I would like to be able to directly launch a Git Bash with the SDK v2.0.0 environment without using the option in Toolchain Manager. Using Toolchain Manager, the "Open bash" option works just fine.

    Thanks!

  • Hi,

    The toolchain was changed in nRF Connect SDK v2.0.0 to be the Zephyr SDK. and not GNU Arm Embedded Toolchain as in previous versions, so running git-bash.exe will not set up gnuarmemb. It should still set up the environment variables for the new toolchain. If this is not the case, please open a new ticket, as the original issue in this ticket has been solved. Thank you!

    Best regards,

    Marte

Related