This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Ubuntu installation of nRF Connect SDK + Visual Studio Code - toolchain question

Hi,

I have made a manual installation of the nRF Connect SDK in order to develop nRF5340 applications on my Ubuntu PC. I have tried, to the best of my ability, to follow the explanations from https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/gs_installing.html

Visual Studio Code was installed according to https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-connect-for-visual-studio-code-preview (although this link mainly explains the Windows case)

GNU Arm EMbedded Toolchain was installed here: ~/gnuarmemb/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux/gcc-arm-none-eabi-9-2019-q4-major   (*)

When I try to "Create a new application from sample..." I get the message "Invalid toolchain installation" under "nRF Connect Toolchain" input box.

I have tried alternatives like PATH and selecting the link marked (*) above, but without any luck.

I have also set the environmental parameters:

export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
export PATH="/home/kg/gnuarmemb/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux/gcc-arm-none-eabi-9-2019-q4-major/bin/":"$PATH"

in the .zephyrrc file

Could you please help me to find the right way to set the nRF Connect (GNU Arm Embedded) Toolchain in VSC in an Ubuntu system?

Many Thanks!!

Parents
  • Hi Knut,

    I was having the same problem until I added this last line to my .zephyrrc file. It ended up looking like this:

    export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
    export GNUARMEMB_TOOLCHAIN_PATH="/opt/gnuarmemb"
    export PATH="/opt/gnuarmemb/bin":"$PATH"

    After this, I opened a terminal and ran (inside my ncs folder):

    source zephyr/zephyr-env.sh

    THEN I opened VS Code from WITHIN the same terminal, this way VS Code is able to see these environmental variables. In the Quick Setup page I just set the nRF Connect SDK parameter to my *ncs* folder, and set nRF Connect Toolchain to PATH. This 'Invalid Toolchain Installation' message did not appear anymore.

    Regards,

    Alex

  • Hi Alex,

    Thanks for the advise! This actually worked! The warning of incorrect toolchain installation disappeared. A KEY point for me is that starting Visual Studio Code in the terminal from the ncs-folder makes the error go away, while starting VSC from the Ubuntu launcher bar causes the problem to persist.

    Really appreciate your good advise!

    Regards, Knut

  • Hi Knut,

    Indeed everytime I launch VSC for this purpose I need to launch it from the terminal after sourcing ncs/zephyrr/zephyr-env.sh.

    I still have no idea how to make these environmental variables persist globally so that VSC has access to them when launched normally. If you ever figure this out, let me know! Or maybe someone from the Nordic Support team has the answer?

    Regards,

    Alex

  • Hi,

     

    Alex Fernandez said:
    I still have no idea how to make these environmental variables persist globally so that VSC has access to them when launched normally. If you ever figure this out, let me know! Or maybe someone from the Nordic Support team has the answer?

    A shortcut from the window manager does not take your local .bashrc settings when launching.

    A wider discussion can be seen here on stack overflow on this topic:

    https://stackoverflow.com/questions/43983718/set-global-path-environment-variable-in-vs-code

     

    A more advanced approach is to edit the desktop shortcut to point to a script that sets up your environment before launching code. If using gnome, the "code" shortcut will be located in /usr/share/application/.

     

    Kind regards,

    Håkon

Reply Children
Related