Setup the Thread SDK¶
This section describes how to set up the Thread SDK development environment on your system.
Set up the toolchain¶
To build the Thread SDK applications, GNU ARM Embedded Toolchain is required. Follow one of the following guides for your host operating system:
macOS¶
-
GNU make is bundled with Xcode tools. Verify by running:
make --v
-
Download and install the GNU ARM Embedded Toolchain. The
7-2018-q2-update
version is recommended. -
Download the nRF5x-Command-Line-Tools-OSX, then extract the
.tar
archive anywhere on your filesystem. Ensure the extracted directory is added to your OS PATH environment variable.# in ~/.bash_profile, add the following script export PATH="<the path to the extracted directory>:${PATH}"
Type the following in your terminal to verify if
mergehex
works:mergehex --version
-
(Optional) Install the latest stable version of pyOCD via
pip
as follows:pip install -U pyocd
Type the following in your terminal to verify if
pyocd
works:pyocd --version
Tip
pyOCD is an open source Python package for programming and debugging Arm Cortex-M microcontrollers using multiple supported types of USB debug probes. If you have a CMSIS-DAP debug probe, it's recommended to install pyOCD.
Windows¶
On Windows the easiest way to install the dependencies is to use the MSYS2. You can do so by performing the following steps:
-
Download and run the installer - "x86_64" for 64-bit, "i686" for 32-bit Windows.
-
Start MSYS2. Update the package database and core system packages with:
pacman -Syu
-
If needed, close MSYS2, run it again from Start menu. Update the rest with:
pacman -Su
-
Install dependencies:
pacman -S git make python2
-
Download and install the GNU ARM Embedded Toolchain. The
7-2018-q2-update
version is recommended. Run the installer and follow the given instructions. -
Download the nRF5x-Command-Line-Tools for Win32. Run the installer and follow the given instructions. Then verify if
mergehex
works:mergehex --version
-
(Optional) Install the latest stable version of pyOCD via
pip
as follows:Type the following in your terminal to verify ifpip install -U pyocd
pyocd
works:pyocd --version
Linux¶
Here we describe how to set up the toolchain on Ubuntu. The steps should be similar for other Linux distributions.
-
Ensure your host system is up to date before proceeding.
sudo apt-get update
sudo apt-get upgrade
-
Install the following packages using your system’s package manager.
sudo apt-get install build-essential checkinstall
-
Download and install the GNU ARM Embedded Toolchain. The
7-2018-q2-update
version is recommended. -
Download the nRF5x-Command-Line-Tools-Linux-xxx, then extract the
.tar
archive anywhere on your filesystem. Ensure the extracted directory is added to your OS PATH environment variable.# in ~/.bash_profile, add the following script export PATH="<the path to the extracted directory>:${PATH}"
Type the following in your terminal to verify if
mergehex
works:mergehex --version
-
(Optional) Install the latest stable version of pyOCD via
pip
as follows:pip install -U pyocd
Type the following in your terminal to verify if
pyocd
works:pyocd --version
Clone the repository¶
Clone the pitaya-go
repository from GitHub:
git clone --recursive https://github.com/makerdiary/pitaya-go
Or if you have already cloned the project, you may update the submodule:
git submodule update --init
Install the nRF5 SDK for Thread¶
The following steps show you how to install and set up the nRF5 SDK for Thread.
Download the SDK file nRF5 SDK for Thread and Zigbee V3.1.0 from www.nordicsemi.com.
Extract the zip file to this directory. This should give you the following folder structure:
./pitaya-go/ ├── LICENSE ├── README.md ├── certs ├── config ├── docs ├── examples ├── external ├── firmware ├── material ├── mkdocs.yml ├── nrf_sdks │ ├── README.md │ ├── nRF5SDKforThreadandZigbeev310c7c4730 │ └── nRF5_SDK_15.2.0_9412b96 └── utils
To use this SDK you first need to set the toolchain path in makefile.windows
or makefile.posix
depending on platform you are using. That is, the .posix
should be edited if your are working on either Linux or macOS. These files are located in:
<nRF5 SDK for Thread and Zigbee>/components/toolchain/gcc
Open the file in a text editor, and make sure that the GNU_INSTALL_ROOT
variable is pointing to your GNU Arm Embedded Toolchain install directory.
GNU_INSTALL_ROOT ?= $(HOME)/gcc-arm-none-eabi/gcc-arm-none-eabi-7-2018-q2-update/bin/ GNU_VERSION ?= 7.3.1 GNU_PREFIX ?= arm-none-eabi
Next Step¶
If everything works as expected, it's ready to build and run the examples to verify the development environment setup.
Follow the steps in Build & Run a Thread example to go on.
Create an Issue¶
Interested in contributing to this project? Want to report a bug? Feel free to click here: