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

  • Hi,

     

    If you hover over it, does it state which component is missing?

    Here's an example from my setup, where gn is missing (from generate-ninja package in ubuntu)

     

    Kind regards,

    Håkon

  • Hi

    I do have the same problem here in Ubuntu 20.04: trying to set the "nRF Connect Toolchain" setting to "~/gnuarmemb/gcc-arm-none-eabi-9-2019-q4-major", also with "/bin" appended, or with the version part of the path removed, user expanded, etc., always results in "Invalid toolchain installation", without further info.

    However, if I set the "nRF Connect Toolchain" setting to "PATH" then I get "Invalid toolchain installation" with an info pop-up on hovering over the message saying: "gnuarmemb is required but not found, gn is required but not found".

    (Note that building with west (e.g. west build -b nrf52840dk_nrf52840 -p) works fine.)

    Could you please disclose what checks are done exactly when changing the setting "nRF Connect Toolchain"? What does "gnuarmemb is required but not found" exactly mean? (The toolchain is there and referenced in the environment variables.) Or could you give a link to the source code of the extension? (I saw there was a version once on github somewhere, but cannot be found anymore.)

    Please find the output of my "nRF Connect: Generate Support Information" below.

    Thanks!

    Support Information:

    {
    "platform": {
    "os": "linux",
    "osVersion": "#41~20.04.2-Ubuntu SMP Fri Sep 24 09:06:38 UTC 2021",
    "osKernel": "5.11.0-37-generic",
    "vscode": "1.61.1",
    "electron": "13.5.1",
    "node": "v14.16.0"
    },
    "system": {
    "date": "2021-10-15T12:28:54.092Z",
    "vscodeRoot": "/snap/code/77/usr/share/code/resources/app",
    "nrfConnectForDesktopInstalled": "unknown",
    "vscodeUptime": "01:07:57",
    "osUptime": "23:42:08",
    "cpu": {
    "model": "Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz",
    "speed": "2300 MHz",
    "count": 4
    },
    "memory": {
    "total": "15.27 GB",
    "free": "1.56 GB"
    }
    },
    "workspace": {
    "name": "Untitled (Workspace)",
    "workspaceFile": "1634227193741",
    "folders": [
    "/home/xxx.../breadboard/breadboard_sw/applications/blinky_pwm"
    ]
    },
    "extensions": {
    "internal": {
    "nordic-semiconductor.nrf-connect": {
    "version": "2021.10.103",
    "path": "/home/xxx/.vscode/extensions/nordic-semiconductor.nrf-connect-2021.10.103",
    "isActive": true
    },
    "nordic-semiconductor.nrf-terminal": {
    "version": "2021.9.26",
    "path": "/home/xxx/.vscode/extensions/nordic-semiconductor.nrf-terminal-2021.9.26",
    "isActive": true
    },
    "nordic-semiconductor.devicetree": null,
    "nordic-semiconductor.kconfig": null
    },
    "external": {
    "marus25.cortex-debug": "0.4.7",
    "ms-vscode.cpptools": "1.7.0",
    "ms-vscode.js-debug": "1.61.0",
    "ms-vscode.js-debug-companion": "1.0.15",
    "ms-vscode.references-view": "0.0.81",
    "ms-vscode.vscode-js-profile-table": "0.0.18",
    "ms-python.python": "2021.10.1336267007",
    "ms-python.vscode-pylance": "2021.10.0",
    "ms-toolsai.jupyter": "2021.9.1001312534",
    "ms-toolsai.jupyter-keymap": "1.0.0",
    "ms-toolsai.jupyter-renderers": "1.0.3",
    "ms-vscode.cmake-tools": "1.8.1",
    "trond-snekvik.gnu-mapfiles": "1.1.0",
    "twxs.cmake": "0.0.17"
    }
    },
    "tools": {
    "jlink": "Not found",
    "/usr/bin/nrfjprog": "10.12.1",
    "/usr/bin/cmake": "3.21.3",
    "/home/xxx/.local/bin/west": "0.11.1",
    "/usr/bin/python": "3.8.10",
    "/usr/bin/ninja": "1.10.0",
    "/usr/bin/gperf": "3.1",
    "/usr/bin/dtc": "1.5.0",
    "gnuarmemb": "Not found",
    "gn": "Not found"
    },
    "config": {
    "nordic-semiconductor.nrf-connect": {
    "topdir": "/home/xxx.../breadboard",
    "toolchain": {
    "path": "PATH"
    },
    "ozonePath": "",
    "applications": [
    "/home/xxx.../breadboard/breadboard_sw/applications/blinky_pwm"
    ],
    "jlink": {
    "rtosPlugin": ""
    },
    "kconfig": {
    "interface": null
    },
    "welcome": {
    "showOnStartup": false
    },
    "west": {
    "env": {
    "$base": "terminal"
    }
    },
    "boardRoots": []
    },
    "nordic-semiconductor.nrf-terminal": {
    "terminalMode": "character"
    },
    "nordic-semiconductor.devicetree": {
    "modules": [
    "${zephyrBase}",
    "${zephyrBase}/../nrf",
    "."
    ],
    "zephyr": "",
    "ctxFile": "",
    "defaultBoard": ""
    },
    "nordic-semiconductor.kconfig": {
    "root": "",
    "env": {},
    "cfiles": true,
    "disable": false,
    "zephyr": {
    "board": {},
    "west": "",
    "base": "",
    "soc_roots": []
    }
    },
    "marus25.cortex-debug": {
    "armToolchainPath": null,
    "armToolchainPrefix": "arm-none-eabi",
    "gdbPath": null,
    "JLinkGDBServerPath": null,
    "openocdPath": null,
    "pyocdPath": null,
    "PEGDBServerPath": null,
    "stutilPath": null,
    "stlinkPath": null,
    "stm32cubeprogrammer": null,
    "enableTelemetry": true,
    "flattenAnonymous": false,
    "registerUseNaturalFormat": true,
    "variableUseNaturalFormat": true
    }
    },
    "environment": {
    "westExe": "west",
    "westEnv": {
    "ELECTRON_RUN_AS_NODE": "1",
    "HOME": "/home/xxx",
    "PATH": "/home/xxx/.local/bin:/home/xxx/bin:/home/xxx/bin/dita-ot-3.5.2/bin:/home/xxx/breadboard/zephyr/scripts:/home/xxx/.local/bin:/home/xxx/bin:/home/xxx/bin/dita-ot-3.5.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
    "ZEPHYR_BASE": "/home/xxx../breadboard/zephyr",
    "GNUARMEMB_TOOLCHAIN_PATH": "/home/xxx/gnuarmemb/gcc-arm-none-eabi-9-2019-q4-major",
    "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
    "USER": "xxx"
    },
    "toolchainPath": "PATH"
    },
    "terminal": {
    "shell": null,
    "defaultProfile": null
    }
    }

  • Hi,

     

    Morvitez said:
    "PATH": "/home/xxx/.local/bin:/home/xxx/bin:/home/xxx/bin/dita-ot-3.5.2/bin:/home/xxx/breadboard/zephyr/scripts:/home/xxx/.local/bin:/home/xxx/bin:/home/xxx/bin/dita-ot-3.5.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
    "ZEPHYR_BASE": "/home/xxx../breadboard/zephyr",
    "GNUARMEMB_TOOLCHAIN_PATH": "/home/xxx/gnuarmemb/gcc-arm-none-eabi-9-2019-q4-major",

    My apologies, we have a known issue at this time where it will not find components/programs that is outside of $PATH.

    If you append the path to gcc to the $PATH var, it should work better. Note that this is a visual issue, rather than a functional issue.

     

    Kind regards,

    Håkon

  • 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

Related