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!

Parents
  • 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!

Reply
  • 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!

Children
No Data
Related