Visual Studio Code discovers wrong gnuarmemb folder

I'm using Linux 20.04.  I have been following the manual installation guide for setting up the nRF Connect SDK and also nRF Toolchain

in my .bashrc file: 

export PATH=${HOME}/gn:"$PATH"
export PATH=$PATH:$GNUARMEMB_TOOLCHAIN_PATH/bin

in my .zephyrrc 

export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
export GNUARMEMB_TOOLCHAIN_PATH="~/gnuarmemb/gcc-arm-none-eabi-10.3-2021.10"
export PATH=$PATH:$GNUARMEMB_TOOLCHAIN_PATH/bin

Then i run source zephyr/zephyr-env.sh in my ncs folder. 

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 appears and detects an older version of gnuarmemb  ( the one installed for previous SDK from nordic). 

whereis arm-none-eabi-gcc
...../gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc

If i go to the sample folders, I'm able to build properly using the west tool on terminal using: west build -b nrf9160dk_nrf9160ns --pristine

What else could i do to fix this? 

Parents
  • Hi

    The "gnuarmemb" folder usually looks like this:

    My guess is that you unzipped the folder into "gnuarmemb", instead of renaming it.
    I am not sure if this should do anything, but it is worth getting it the same way as the tutorial.

    When installing the nRF Connect extension for VS Code on Ubuntu, I fix the "Invalid Toolchain Installation" by setting:

    export PATH=$PATH:$HOME/gnuarmemb/bin

    in .bashrc.
    This looks like the same as you have done. I also agree with you, using $GNUARMEMB_TOOLCHAIN_PATH is cleaner though.

    The reason why it goes in .bashrc can be seen in ".vscode/extensions/nordic-semiconductor.nrf-connect-2021.11.221/docs/west.md":
    "To get around this issue, the extension will query Bash for its environment on Linux and macOS. This executes the `~/.bashrc` file"

    So the extension should run .bashrc for you, meaning that you do not need to run VS Code from the command line.

    Did this help you fix the problem?

    Regards,
    Sigurd Hellesvik

Reply
  • Hi

    The "gnuarmemb" folder usually looks like this:

    My guess is that you unzipped the folder into "gnuarmemb", instead of renaming it.
    I am not sure if this should do anything, but it is worth getting it the same way as the tutorial.

    When installing the nRF Connect extension for VS Code on Ubuntu, I fix the "Invalid Toolchain Installation" by setting:

    export PATH=$PATH:$HOME/gnuarmemb/bin

    in .bashrc.
    This looks like the same as you have done. I also agree with you, using $GNUARMEMB_TOOLCHAIN_PATH is cleaner though.

    The reason why it goes in .bashrc can be seen in ".vscode/extensions/nordic-semiconductor.nrf-connect-2021.11.221/docs/west.md":
    "To get around this issue, the extension will query Bash for its environment on Linux and macOS. This executes the `~/.bashrc` file"

    So the extension should run .bashrc for you, meaning that you do not need to run VS Code from the command line.

    Did this help you fix the problem?

    Regards,
    Sigurd Hellesvik

Children
Related