Skip to content

Setting Up the OpenThread Mesh SDK

This section describes how to set up the nRF5 SDK for Thread development environment on your host operating system.

Set up the toolchain

To build the nRF5 SDK for Thread examples, GNU ARM Embedded Toolchain is required. Follow one of the following guides for your host operating system:

macOS

  1. GNU make is bundled with Xcode tools. Verify by running:

    make --v
    

  2. Download and install the GNU ARM Embedded Toolchain. The 7-2018-q2-update version is required. If you already have another version of arm-none-eabi installed, ensure to modify your OS PATH environment variable.

    # in ~/.bash_profile, add the following script
    export PATH="<path to install directory>/gcc-arm-none-eabi-7-2018-q2-update/bin:${PATH}"
    
    Type the following in your terminal to verify if the path is set correctly:

    arm-none-eabi-gcc --version
    
  3. 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
    

  4. 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
    

Windows

On Windows the easiest way to install the dependencies is to use the MSYS2. You can do so by performing the following steps:

  1. Download and run the installer - "x86_64" for 64-bit, "i686" for 32-bit Windows.

  2. Start MSYS2. Update the package database and core system packages with:

    pacman -Syu
    
  3. If needed, close MSYS2, run it again from Start menu. Update the rest with:

    pacman -Su
    
  4. Install dependencies:

    pacman -S git make python2
    
  5. Download and install the GNU ARM Embedded Toolchain. The 7-2018-q2-update version is required. Run the installer and follow the given instructions. Upon completion, check the Add path to environment variable option. Then verify if the compiler works:

    arm-none-eabi-gcc --version
    
  6. Download the nRF5x-Command-Line-Tools for Win32. Run the installer and follow the given instructions. Then verify if mergehex works:

    mergehex --version
    
  7. 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
    

Linux

This section describes how to set up the development environment on Ubuntu. The steps should be similar for other Linux distributions.

  1. Ensure your host system is up to date before proceeding.

    sudo apt-get update
    
    sudo apt-get upgrade
    

  2. Install the following packages using your system’s package manager.

    sudo apt-get install build-essential checkinstall
    
  3. Download and install the GNU ARM Embedded Toolchain. The 7-2018-q2-update version is required. If you already have another version of arm-none-eabi installed, ensure to modify your OS PATH environment variable.

    # in ~/.bash_profile, add the following script
    export PATH="<path to install directory>/gcc-arm-none-eabi-7-2018-q2-update/bin:${PATH}"
    
    Type the following in your terminal to verify if the path is set correctly:

    arm-none-eabi-gcc --version
    
  4. 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
    

  5. 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 grove-mesh-kit repository from GitHub:

git clone --recursive https://github.com/makerdiary/grove-mesh-kit

Where adding --recursive will clone all the necessary dependencies.

Or if you have already cloned the project, you may update the submodule:

git submodule update --init

Install the nRF5 SDK for Thread

Download the SDK file nRF5 SDK for Thread and Zigbee V3.0.0 from www.nordicsemi.com.

Extract the zip file to the grove-mesh-kit repository. This should give you the following folder structure:

./grove-mesh-kit/
├── LICENSE
├── README.md
├── config
├── deps
│   └── openthread
├── docs
├── examples
├── firmware
├── mkdocs.yml
└── nrf_sdks
    ├── README.md
    ├── nRF5-SDK-for-Mesh
    ├── nRF5SDKforThreadandZigbeev300d310e71
    └── nRF5_SDK_v15.2.0_9412b96

To use the Thread 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:

<Thread SDK>/components/toolchain/gcc

Open the file in a text editor (Sublime is recommended), 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 Steps

Congratulations! Now you can try to build and run the mesh examples. Head to Building & Running the examples section for more details.

Create an Issue

Interested in contributing to this project? Want to report a bug? Feel free to click here: