Skip to content

How to use SDK on Ubuntu

Gwendal edited this page Mar 13, 2020 · 1 revision

This guide will help you to set up your environment on a Linux system.

We use Ubuntu 19.10 in this guide.

Some steps may differ depending on the version of Ubuntu or a different Linux distribution.

Requirements

Python

Ubuntu 19.10 has Python3 installed by default.

You can check it as followed:

$ python3 --version
Python 3.7.5rc1

pip

pip must be installed:

$ sudo apt install python3-pip

virtualenv

It is recommended to use a virtual environment as followed (optional):

$ pip3 install virtualenv

$ virtualenv venv-sdk

$ source venv-sdk/bin/activate

pycryptodome

Install pycryptodome package (add sudo if not using virtualenv):

pip install pycryptodome

Arm Compiler

We recommend the version 7.2.1 (7-2017-q4-major) for GCC Arm toolchain

Install it with following commands:

$ wget -O gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2 https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2017q4/gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2?revision=375265d4-e9b5-41c8-bf23-56cbe927e156?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,7-2017-q4-major

$ tar xjf gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2

Please note down the full path of the bin folder of your installation:

$ cd gcc-arm-none-eabi-7-2017-q4-major/bin

$ pwd
/home/gwendal/gcc-arm-none-eabi-7-2017-q4-major/bin

Git

Git is needed to clone the GitHub repository

sudo apt install git

Get the sources

All sources are available from github repo.

If you have a github account (and an ssh key set), you can clone the repo with ssh.

Otherwise use the https option:

$ git clone https://github.com/wirepas/wm-sdk.git

Select the tag you want to use:

$ cd wm-sdk

$ git tag
v1.0.0

$ git checkout v1.0.0

📝 You will be on a detached HEAD at this point. You can create a local branch if you want at this stage

Edit config.mk

In order too use the right compiler, you can either add the previously Arm toolchain to your PATH or edit config.mk as followed:

$ nano config.mk

Edit the arm_toolchain variable to point to the Arm toolchain installed in previous step

In our example:

# Specify the arm toolchain to use (leave it blank if already set in your PATH)
arm_toolchain=/home/gwendal/gcc-arm-none-eabi-7-2017-q4-major/bin/

Copy binaries

Copy the binaries you received from Wirepas into image folder

Build your app

$ make app_name=<app_name> target_board=<target_board>

All the built images will be available in folder build/<target_board>/<app_name>/

Remarks

Those steps must be adapted to your own system and choices. It is also possible to setup it on Windows (with WSL, Cygwin, ...) but not covered in this guide.