Install Zephyr RTOS on Ubuntu 20.04

Install Zephyr and Toolchain

  1. Getting started Guide is a good place to start. However there could be issues if versions of cmake, python and device tree compiler does no match minimum requirements.
  2. At time of writing this note the minimum version for cmake was 3.20.0 – cmake on my machine was a previous version. Here is how I fixed it : See section A. Using APT repositories (Recommended for normal users)

Install NRF Command line tools:

  1. Download the tar file
  2. Open terminal
## Note the version number in filename could be different
sudo cp nrf-command-line-tools-10.15.4_Linux-amd64.tar.gz /opt/.

cd /opt
tar -xzf nrf-command-line-tools-10.15.4_Linux-amd64.tar.gz

## INSTALL JLINK
## At this stage do a quick check if you have JLink_Linux_*.deb file
## if yes then install that as follows
## note: Your .deb filename could be a bit different especially version number
sudo dpkg -i --force-overwrite JLink_Linux_V758b_x86_64.deb

# follow the instructions in to create links
# I had to create the links using different pathnames
cat README.txt 

cd /usr/local/bin
sudo ln -s /opt/nrf-command-line-tools/bin/nrfjprog /usr/local/bin/nrfjprog
sudo ln -s /opt/nrf-command-line-tools/bin/mergehex /usr/local/bin/mergehex

# get back to $HOME
cd
# verify if you can access nrfjprog, mergehex
nrfjprog --version

mergehex --version

Build and Flash verification

Open Terminal

## Your board could be different use appropriate values for -b
cd ~/zerphyproject/zephyr
west build -b nrf52dk_nrf52832 samples/blinky
## Assumes a DK is connected over USB to the host machine
west flash
## If all goes well you should see the LED blinking on the DK