Requirements

Linux based OS

The actual version of KNoT Zephyr SDK is only available for Linux based systems. On other systems, you may consider using the KNoT Docker (recommended) or a Virtual Machine running a Linux distribution.

Zephyr

KNoT uses a fork of Zephyr repository.

  • Set up a Zephyr development environment by following these instructions.

  • Program the $HOME/.profile to always set ZEPHYR_TOOLCHAIN_VARIANT and ZEPHYR_SDK_INSTALL_DIR.

$ echo "export ZEPHYR_TOOLCHAIN_VARIANT=zephyr" >> $HOME/.profile
$ echo "export ZEPHYR_SDK_INSTALL_DIR=`readlink -f <SDK-INSTALLATION-DIRECTORY>`" >> $HOME/.profile

Note

Replace <SDK-INSTALLATION-DIRECTORY> by the actual Zephyr SDK install path

  • Install the west binary and bootstrapper

$ pip3 install --user west
  • Create an enclosing folder and change directory

$ mkdir zephyrproject
$ cd zephyrproject
  • Clone KNoT Zephyr fork

$ git clone -b zephyr-knot-v1.14.0 https://github.com/CESARBR/zephyr.git
  • Initialize west. Inside zephyrproject directory run:

$ west init -l zephyr/
$ west update

Note

If the system can’t find west, try logging out and in again.

  • Set up zephyr environment variables

$ source zephyr/zephyr-env.sh
  • Program the $HOME/.profile to always source zephyr-env.sh when you log in.

$ echo "source $ZEPHYR_BASE/zephyr-env.sh" >> $HOME/.profile

Note

If you skip this step, it will be necessary to manually source zephyr-env.sh every time a new terminal is opened.

Source KNoT environment configuration file

  • Download the zephyr-knot-sdk repository to a folder you prefer.

$ git clone https://github.com/cesarbr/zephyr-knot-sdk/
  • The environment configuration file is used to set up KNOT_BASE path.

$ source zephyr-knot-sdk/knot-env.sh
  • Program the $HOME/.profile to always source knot-env.sh when you log in.

$ echo "source $KNOT_BASE/knot-env.sh" >> $HOME/.profile

Add support to the KNoT command line interface

  • Add cli.py to the path files.

$ ln -s $KNOT_BASE/scripts/cli.py $HOME/.local/bin/knot

Note

This will allow you to call the knot command line interface from any folder.

  • Use pip to install cli requirements

$ pip3 install --user -r ${KNOT_BASE}/scripts/requirements.txt

Note

If you skip this step, it will be necessary to manually source knot-env.sh every time a new terminal is opened.

KNoT protocol

Add USB access to your user

  • Add your user to the dialout group.

$ sudo usermod -a -G dialout `whoami`

Apply changes to profile

  • In order to apply the changes to your user, you must log out and log in again.