Setting up terminal environment with nRF Toolchain

Hi,

I’m currently working on a Zephyr project using the nRF Connect SDK, and I am looking for a way to setup the toolchain for my terminal emulator (specifically using zsh). I don't want to rely on any external Toolchain Managers or such, and was hoping there would a simple shell script to activate the toolchain but couldn't find any. It would be nice to be able to compile everything from the command line with just a few simple steps not to mention setting up CI pipelines without needing to install vscode or other tools besides the toolchain. Is there a way to do it or do I need to write my own script to set up all the PATH, LD_LIBRARY_PATH etc. environment variables?

Parents
  • Hello,

    I don't want to rely on any external Toolchain Managers or such, and was hoping there would a simple shell script to activate the toolchain but couldn't find any.

    I found that using the toolchain manager app in nRF Connect for Desktop gives me this functionality. I know you said you didn't want to "rely on any external Toolchain Manager", but if you use it to set it up once, you can call it directly from any command line later.

    So what I do is that I install the SDK and Toolchain via nRF Connect for Desktop -> Toolchain Manager. After that, there is a drop down arrow next to the NCS version that I installed, which has an option: "Generate Environment Script":

    Now, save this file somewhere on your computer, and add the location of that file to your environment path. You may want to name the file somewhat related to the NCS version that it represents. As an example, I call mine NCS_2.9.0.cmd. When this is added to path, I can write "NCS_2.9.0" in any terminal window, and it will set up the toolchain and path for me, and I can continue with "west build -b ...".

    Is that something that can work for you?

    Best regards,

    Edvin

Reply
  • Hello,

    I don't want to rely on any external Toolchain Managers or such, and was hoping there would a simple shell script to activate the toolchain but couldn't find any.

    I found that using the toolchain manager app in nRF Connect for Desktop gives me this functionality. I know you said you didn't want to "rely on any external Toolchain Manager", but if you use it to set it up once, you can call it directly from any command line later.

    So what I do is that I install the SDK and Toolchain via nRF Connect for Desktop -> Toolchain Manager. After that, there is a drop down arrow next to the NCS version that I installed, which has an option: "Generate Environment Script":

    Now, save this file somewhere on your computer, and add the location of that file to your environment path. You may want to name the file somewhat related to the NCS version that it represents. As an example, I call mine NCS_2.9.0.cmd. When this is added to path, I can write "NCS_2.9.0" in any terminal window, and it will set up the toolchain and path for me, and I can continue with "west build -b ...".

    Is that something that can work for you?

    Best regards,

    Edvin

Children
Related