nRF Connect SDK Fundamentals – [Lesson 1] – Exercise 1 – Installing nRF Connect SDK and VS Code – v2.9.0-v2.7.0

Installing nRF Connect SDK and VS Code

Follow the steps below to install the nRF Connect SDK, its toolchain, and VS Code IDE. Starting September 2023, It is possible to download nRF Connect SDK and its toolchain directly from within VS Code, as explained in this guide.

In the first three steps (1-3), we will download the tools needed to flash firmware to the various Nordic Semiconductor development kits supported on DevAcademy (nRF Command Line Tools, Segger J-Link, and nrfutil and nrfutil device command).

1. Install nRF Command Line Tools.

Download the latest version that matches your operating system.

Download link: https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools/Download?lang=en#infotabs.

Note

The nRF Command Line Tools is in the process of being archived. nRF Command Line Tools will remain available for download but will gradually be replaced by nRF Util. For courses on DevAcademy, you will need both nRF Command Line Tools and nRF Util during this transition period.

2. Installl SEGGER J-Link v8.10f

Download the installer for your platform from SEGGER J-Link Software. Run the installer; when you reach the ‘Choose Optional Components’ window during installation, be sure to select ‘Install Legacy USB Driver for J-Link’ This driver is necessary for some supported Development Kits

3. Install nrfutil and the nrfutil device command

3.1 Download the binary compatible with your OS from the nRF Util product page and store it somewhere on your disk drive (For example C:\nordic_tools\nrfutil.exe for Windows).
If you are running on macOS or Linux, you can store it in a folder that is already added in the system’s PATH (E.g. /usr/bin/ ), so that you can skip step 3.2

Note

For Linux, keep in mind that nrfutil has some prerequisites that are listed in Installing nRF Util prerequisites. Make sure you also download them, if you don’t have them on your machine already.

3.2 (Windows) Update your system’s PATH to include the location where nrfutil is stored. Open Edit environment variable for your account and add the path where you stored the nrfutil binary, as shown below:

3.3 The nrfutil binary you just downloaded does not come with any pre-installed commands. In this step, we will upgrade the core nrfutil and download the device command.

3.3.1 To make sure we have the latest nrfutil version, run the following command in a terminal (Command Prompt or PowerShell). It doesn’t matter which terminal since nrfutil is set globally in step 3.2.

nrfutil self-upgrade
Terminal command

3.3.2 Install the nrfutil device command

For this course, we will need the device command to flash binaries to development kits.

In your active terminal, type:

nrfutil install device
Terminal command

You should see the following output :

[00:00:02] ###### 100% [Install packages] Install packages
Terminal

4. Install VS Code.

Go to https://code.visualstudio.com/download and install the version that matches your operating system.

5. Install nRF Connect Extension Pack.

In the Activity Bar, click the Extensions icon, then type nRF Connect for VS Code Extension Pack in the search field, and click on Install, as shown in the illustration below:

nRF Connect for VS Code extension pack allows developers to use the popular Visual Studio Code Integrated Development Environment (VS Code IDE) to develop, build, debug, and deploy embedded applications based on Nordic’s nRF Connect SDK (Software Development Kit). It includes an interface to the compiler, linker, the whole build system, an RTOS-aware debugger, a seamless interface to the nRF Connect SDK, the Devicetree Visual Editor, and an integrated serial terminal, among other valuable development tools.

nRF Connect for VS Code extension pack consists of the following components:

  • nRF Connect for VS Code: The main extension contains an interface to the build system and nRF Connect SDK. It also provides an interface to manage nRF Connect SDK versions and toolchains.
  • nRF DeviceTree: Provides Devicetree language support and the Devicetree Visual Editor.
  • nRF Kconfig: Provides Kconfig language support.
  • nRF Terminal: A serial and RTT terminal.
  • C/C++ from Microsoft: Adds language support for C/C++, including features such as IntelliSense.
  • CMake: CMake language support.
  • GNU Linker Map Files: Linker map files support.

We can download any nRF Connect SDK version of our preference and its toolchain through the extension. Complete documentation of the nRF Connect for VS Code is available here.

Note

It’s crucial to install the nRF Connect for VS Code Extension Pack, as shown in the video above, not just nRF Connect for VS Code, in order to get all the available features.

6. Install Toolchain.

The toolchain is a set of tools that are used together to build nRF Connect SDK applications. It includes the assembler, compiler, linker, and CMake, among other tools.

The first time you open nRF Connect for VS Code, it will prompt you to install a toolchain. This usually happens when the extension does not find any installed toolchain on your machine.

Click on Install Toolchain. It will list the available versions of toolchains that can be downloaded and installed on your machine. Select the toolchain version that matches the nRF Connect SDK version you plan to use. We always recommend using the latest tagged version of the nRF Connect SDK.

Installing the toolchain will take some time, depending on your development platform specifications and internet speed. The video below is sped up.

Note

By default, nRF Connect for VS Code displays only released tags (also known as stable versions) of toolchains. If you are evaluating new features and want to use a preview tag or a different type of tag (for example, customer sampling -cs), click on “Show All Toolchain Versions.” as shown below:

Note that for production code, only released tags should be used.

7. Install nRF Connect SDK.

In nRF Connect for VS Code, click on Manage SDKs in the left margin under the WELCOME panel. Through the Manage SDKs, we can install, uninstall nRF Connect SDK versions. Since this is our first time using the extension, we will see only two options. Click on Install SDK. It will list the available versions of the nRF Connect SDK that can be downloaded and installed on your machine. Choose the nRF Connect SDK version you wish to use for your project development.

Note

If you have opened the SDK folder in VS Code, the Manage SDKs menu option will not be present, and you will instead see Manage west workspace. To fix this, open another window or folder in VS Code.
If you don’t see either options, make sure you have the latest version of the nRF Connect for VS Code extension pack.

In the illustration below, we are showing how to install nRF Connect SDK version 2.4.2. which is the latest released tag at the time of recording. Depending on your internet and machine speed, this will take some time to finish. The video below is sped up.

Important

We recommend installing the latest released tag of nRF Connect SDK listed to get all the latest features and patches.

With this, we have completed the installation of nRF Connect SDK and VS Code. The following exercise will teach us how to build and flash our first nRF Connect SDK application to our board.

It’s also worth noting that nRF Connect SDK is IDE agnostic, which means you can use it with the IDE of your choice or without an IDE. It is possible to download and install the nRF Connect using a command-line interface (CLI) through nRF Util (nrfutil). However, we highly recommend using VS Code with our nRF Connect for VS Code extension pack as it contains both a convenient graphical user interface (GUI) and an efficient command-line interface (CLI) in one place, in addition to many features that make firmware development much easier. Setting up another IDE to work with the nRF Connect SDK will require some extra manual steps that are out of the scope of this course.

Switch language?

Progress is tracked separately for each language. Switching will continue from your progress in that language or start fresh if you haven't begun.

Your current progress is saved, and you can switch back anytime.

Register an account
Already have an account? Log in
(All fields are required unless specified optional)

  • 8 or more characters
  • Upper and lower case letters
  • At least one number or special character

Forgot your password?
Enter the email associated with your account, and we will send you a link to reset your password.