Skip to content

Getting Started Guide

This guide walks you through setting up the nRF Connect SDK development environment, building and running the Hello World sample on the nRF9151 Connect Kit.

The nRF Connect SDK is based on the Zephyr Project, which means everything required by Zephyr’s Getting Started Guide is also suitable for the nRF Connect SDK.

Select and Update OS

Install available updates for your operating system:

Select Start > Settings > Update & Security > Windows Update. Click Check for updates and install any that are available.

On macOS Mojave or later, select System Preferences... > Software Update. Click Update Now if necessary.

On other versions, see this Apple support topic.

This guide covers Ubuntu version 20.04 LTS and later.

sudo apt update
sudo apt upgrade

Install dependencies

Next, you’ll install some host dependencies using your package manager.

The current minimum required version for the main dependencies are:

Tool Min. Version
CMake 3.20.5
Python 3.10
Devicetree compiler 1.4.6

Chocolatey is recommended to install dependencies here. If Chocolatey isn’t an option, you can install dependencies from their respective websites and ensure the command line tools added in your PATH environment variable.

  1. Install chocolatey.

  2. Open a cmd.exe window as Administrator. To do so, press the Windows key Win , type cmd.exe, right-click the result, and choose Run as Administrator.

  3. Disable global confirmation to avoid having to confirm the installation of individual programs:

    choco feature enable -n allowGlobalConfirmation
    
  4. Use choco to install the required dependencies:

    choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
    
    choco install ninja gperf python311 git dtc-msys2 wget 7zip
    
  5. Close the terminal window and open a new cmd.exe window as a regular user to continue.

Tip

To check the list of installed packages and their versions, run the following command:

choco list -lo
  1. Install Homebrew:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. After the Homebrew installation script completes, follow the on-screen instructions to add the Homebrew installation to the path.

    (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> ~/.zprofile
    
    source ~/.zprofile
    
    (echo; echo 'eval "$(/usr/local/bin/brew shellenv)"') >> ~/.zprofile
    
    source ~/.zprofile
    
  3. Use brew to install the required dependencies:

    brew install cmake ninja gperf python3 python-tk ccache qemu dtc libmagic wget openocd
    
  4. Add the Homebrew Python folder to the path, in order to be able to execute python and pip as well python3 and pip3.

    (echo; echo 'export PATH="'$(brew --prefix)'/opt/python/libexec/bin:$PATH"') >> ~/.zprofile
    
    source ~/.zprofile
    

Tip

To check the versions of these dependencies installed, run the following command:

brew list --versions
  1. If using an Ubuntu version older than 22.04, it is necessary to add extra repositories to meet the minimum required versions for the main dependencies listed above. In that case, download, inspect and execute the Kitware archive script to add the Kitware APT repository to your sources list. A detailed explanation of kitware-archive.sh can be found here kitware third-party apt repository:

    wget https://apt.kitware.com/kitware-archive.sh
    
    sudo bash kitware-archive.sh
    
  2. Use apt to install the required dependencies:

    1
    2
    3
    4
    sudo apt install --no-install-recommends git cmake ninja-build gperf \
    ccache dfu-util device-tree-compiler wget \
    python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
    make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1
    

    Note

    Due to the unavailability of gcc-multilib and g++-multilib on AArch64 (ARM64) systems, you may need to remove them from the list of packages to install.

  3. Verify the versions of the main dependencies installed on your system by entering:

    cmake --version
    
    python3 --version
    
    dtc --version
    

Get the code and install Python dependencies

To help you quickly build and run the samples on the nRF9151 Connect Kit, the primary nrf9151-connectkit repository contains the nRF Connect SDK manifest repositories, additional hardware drivers and tested samples, etc.

In the following instructions the name NCS-Project is used for the workspace, however in practice its name and location can be freely chosen. You’ll also install additional Python dependencies in a Python virtual environment.

  1. Open a cmd.exe terminal window as a regular user

  2. Create a new virtual environment:

    python -m venv NCS-Project\.venv
    
  3. Activate the virtual environment:

    NCS-Project\.venv\Scripts\activate.bat
    

    Once activated your shell will be prefixed with (.venv). The virtual environment can be deactivated at any time by running deactivate.

    Note

    Remember to activate the virtual environment every time you start working.

  4. Install west:

    pip install west
    
  5. Get the latest source code:

    west init -m https://github.com/makerdiary/nrf9151-connectkit --mr main NCS-Project
    

    Tip

    You can initialize west with the revision of the project that you want to check out. For example, to check out the v1.0.0 release, use the following command instead:

    west init -m https://github.com/makerdiary/nrf9151-connectkit --mr v1.0.0 NCS-Project
    
  6. Enter the following commands to clone the project repositories:

    cd NCS-Project
    
    west update
    

    After all the repositories updated, your workspace folder now looks similar to this:

    NCS-Project
    |___ .venv
    |___ .west
    |___ bootloader
    |___ modules
    |___ nrf
    |___ nrf9151-connectkit
    |___ nrfxlib
    |___ test
    |___ tools
    |___ zephyr
    |___ ...
    
  7. Export a Zephyr CMake package. This allows CMake to automatically load boilerplate code required for building Zephyr applications.

    west zephyr-export
    
  8. The Zephyr west extension command west packages can be used to install Python dependencies.

    west packages pip --install
    
  1. Create a new virtual environment:

    python3 -m venv ~/NCS-Project/.venv
    
  2. Activate the virtual environment:

    source ~/NCS-Project/.venv/bin/activate
    

    Once activated your shell will be prefixed with (.venv). The virtual environment can be deactivated at any time by running deactivate.

    Note

    Remember to activate the virtual environment every time you start working.

  3. Install west:

    pip install west
    
  4. Get the latest source code:

    west init -m https://github.com/makerdiary/nrf9151-connectkit --mr main NCS-Project
    

    Tip

    You can initialize west with the revision of the project that you want to check out. For example, to check out the v1.0.0 release, use the following command instead:

    west init -m https://github.com/makerdiary/nrf9151-connectkit --mr v1.0.0 NCS-Project
    
  5. Enter the following commands to clone the project repositories:

    cd NCS-Project
    
    west update
    

    After all the repositories updated, your workspace folder now looks similar to this:

    NCS-Project
    |___ .venv
    |___ .west
    |___ bootloader
    |___ modules
    |___ nrf
    |___ nrf9151-connectkit
    |___ nrfxlib
    |___ test
    |___ tools
    |___ zephyr
    |___ ...
    
  6. Export a Zephyr CMake package. This allows CMake to automatically load boilerplate code required for building Zephyr applications.

    west zephyr-export
    
  7. The Zephyr west extension command west packages can be used to install Python dependencies.

    west packages pip --install
    
  1. Use apt to install Python venv package:

    sudo apt install python3-venv
    
  2. Create a new virtual environment:

    python3 -m venv ~/NCS-Project/.venv
    
  3. Activate the virtual environment:

    source ~/NCS-Project/.venv/bin/activate
    

    Once activated your shell will be prefixed with (.venv). The virtual environment can be deactivated at any time by running deactivate.

    Note

    Remember to activate the virtual environment every time you start working.

  4. Install west:

    pip install west
    
  5. Get the latest source code:

    west init -m https://github.com/makerdiary/nrf9151-connectkit --mr main NCS-Project
    

    Tip

    You can initialize west with the revision of the project that you want to check out. For example, to check out the v1.0.0 release, use the following command instead:

    west init -m https://github.com/makerdiary/nrf9151-connectkit --mr v1.0.0 NCS-Project
    
  6. Enter the following commands to clone the project repositories:

    cd NCS-Project
    
    west update
    

    After all the repositories updated, your workspace folder now looks similar to this:

    NCS-Project
    |___ .venv
    |___ .west
    |___ bootloader
    |___ modules
    |___ nrf
    |___ nrf9151-connectkit
    |___ nrfxlib
    |___ test
    |___ tools
    |___ zephyr
    |___ ...
    
  7. Export a Zephyr CMake package. This allows CMake to automatically load boilerplate code required for building Zephyr applications.

    west zephyr-export
    
  8. The Zephyr west extension command west packages can be used to install Python dependencies.

    west packages pip --install
    

Install the Zephyr SDK

The Zephyr Software Development Kit (SDK) contains toolchains for each of Zephyr’s supported architectures, which include a compiler, assembler, linker and other programs required to build Zephyr applications.

For Linux, it also contains additional host tools, such as custom QEMU and OpenOCD builds that are used to emulate, flash and debug Zephyr applications.

Install the Zephyr SDK using the west sdk install.

cd NCS-Project\zephyr
west sdk install -t arm-zephyr-eabi

Install the Zephyr SDK using the west sdk install.

cd ~/NCS-Project/zephyr
west sdk install -t arm-zephyr-eabi

Install the Zephyr SDK using the west sdk install.

cd ~/NCS-Project/zephyr
west sdk install -t arm-zephyr-eabi

Tip

Using the command options, you can specify the SDK installation destination and which architecture of toolchains to install. See west sdk install --help for details.

Build the Hello World sample

Now, you can build the Hello World sample with west build, specifying the board (following the -b option) as nrf9151_connectkit/nrf9151.

cd NCS-Project\nrf9151-connectkit
west build -p always -b nrf9151_connectkit/nrf9151 samples\hello_world
cd ~/NCS-Project/nrf9151-connectkit
west build -p always -b nrf9151_connectkit/nrf9151 samples/hello_world
cd ~/NCS-Project/nrf9151-connectkit
west build -p always -b nrf9151_connectkit/nrf9151 samples/hello_world

The -p always option forces a pristine build, and is recommended for new users. Users may also use the -p auto option, which will use heuristics to determine if a pristine build is required, such as when building another sample.

Flash and run the sample

Connect the nRF9151 Connect Kit to the computer with a USB-C cable:

Then flash the sample using west flash:

west flash

Open up a serial terminal, specifying the correct serial port that your computer uses to communicate with the nRF9151 SiP:

  1. Start PuTTY.
  2. Configure the correct serial port and click Open:

Open up a terminal and run:

screen <serial-port-name> 115200

Open up a terminal and run:

screen <serial-port-name> 115200

Observe the output of the terminal. You should see the output, similar to what is shown in the following:

Terminal
1
2
3
4
5
6
7
8
9
*** Booting nRF Connect SDK v2.9.99-98a5e50b9ac1 ***
*** Using Zephyr OS v3.7.99-693769a5c735 ***
[0] Hello World! nrf9151_connectkit/nrf9151
[1] Hello World! nrf9151_connectkit/nrf9151
[2] Hello World! nrf9151_connectkit/nrf9151
[3] Hello World! nrf9151_connectkit/nrf9151
[4] Hello World! nrf9151_connectkit/nrf9151
[5] Hello World! nrf9151_connectkit/nrf9151
...

Next steps

Explore more applications or samples running on the nRF9151 Connect Kit:

  • Explore applications


    Show how to implement typical user scenarios and can be served as a starting point for developing your product.

    Learn more

  • Explore samples


    Show how to implement typical use cases with Nordic Semiconductor libraries and drivers.

    Learn more

  • nRF Connect SDK Documentation


    Official latest documentation for the nRF Connect SDK maintained by Nordic Semiconductor.

    Learn more

  • Zephyr Project Documentation


    Learn everything about the Zephyr Project, including architecture, features and application development, etc.

    Learn more