Toolchain Setup

In this document we will describe the installation of tools for working with firmware - the firmware toolchain. The toolchain is designed to allow the firmware operations on all the supported operating systems using a command line in a uniform manner.

Note

Orientation on a command line interface has the advantage to build your firmware automatically on server, e.g. on commit to GitHub via Travis CI continuous integration service.

The firmware toolchain consists of several fundamental components:

  • Compiler GCC ARM Embedded

  • Version control system Git

  • Interpret for scripting language Python 3

  • DFU upload utility dfu-util

  • Program HARDWARIO Firmware Tool

At the end of the article, we’ll show how to develop and compile firmware with popular editors like Atom or Visual Studio Code.

To install, go to one of the supported platforms:

To upgrade an existing installation, go to one of the supported platforms:

Setup on Windows

Caution

You will need administrator rights to install.

Step 1: Download the current version of the HARDWARIO Toolchain Windows installer

Releases on GitHub

Step 2: Launch the downloaded installer and choose the destination directory

Windows location

Step 3: Now you can adjust the desired Path environment variable (we recommend to leave the default settings if in doubt) and proceed with the installation

Windows PATH

Step 4: The FTDI driver setup will launch automatically during the installation - install it

FTDI

Step 5: After finishing the installation, launch the HARDWARIO Toolchain using one these 3 ways

  • From the Desktop

  • From the Start menu

  • From the context menu on the selected directory (using a right-click)

Tip

The advantage of the context menu is to open the HARDWARIO Toolchain directly in the directory location you need to work with.

CMD Toolchain

Step 6: Continue on the document Toolchain Guide. You may also try

Update on Windows

  • Download and install the new version according to the chapter Setup on Windows.

Uninstall on Windows

Uninstall Apps & features:

Windows Uninstall

Setup on macOS

Warning

The following procedure has been tested on macOS 10.12.

Step 1: Open the Terminal application

Step 2: Install Homebrew (unless you already have it)

Note

Homebrew is the package management system and the ecosystem of packages for macOS.

Step 3: Install GCC ARM Embedded

brew tap armmbed/formulae
brew install armmbed/formulae/arm-none-eabi-gcc

Step 4: Install Git

brew install git

Step 5: Install dfu-util

brew install dfu-util

Step 6: Install Python 3

brew install python3

Step 7: Update pip (Python Package Manager) to the latest version

sudo pip3 install --upgrade --no-cache-dir pip

Step 8: Install HARDWARIO Firmware Tool

sudo pip3 install --upgrade --no-cache-dir bcf

Step 9: Continue on the document Toolchain Guide. You may also try

Update on macOS

Step 1: Update of packages

brew update && brew upgrade

Step 2: HARDWARIO Firmware tool update

sudo pip3 install --upgrade --no-cache-dir bcf

Setup on Ubuntu

Warning

The following procedure has been tested on Ubuntu 20.04 LTS.

Step 1: Open the Terminal application

Step 2: Download libisl15 library

wget http://mirrors.kernel.org/ubuntu/pool/main/i/isl/libisl15_0.16.1-1_amd64.deb

Step 3: Install libisl15 library

sudo dpkg -i libisl15_0.16.1-1_amd64.deb

Step 4: Add apt keys

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D1FAA6ECF64D33B0

Step 5: Add team-gcc-arm-embedded-ubuntu repository to source list

echo "deb http://ppa.launchpad.net/team-gcc-arm-embedded/ppa/ubuntu bionic main" | sudo tee /etc/apt/sources.list.d/team-gcc-arm-embedded-ubuntu-ppa-eoan.list

Step 6: Update the index of the available packages

sudo apt update

Step 7: Install common software properties

sudo apt-get install software-properties-common

Step 8: Install compiler and necessary tools

sudo apt install gcc-arm-embedded git dfu-util python3 python3-pip python3-setuptools

Step 9: Update pip (Python Package Manager) to the latest version

sudo pip3 install --upgrade --no-cache-dir pip

Step 10: Install HARDWARIO Firmware Tool

sudo pip3 install --upgrade --no-cache-dir --ignore-installed bcf

Step 11: Add user to dialout group

sudo adduser $USER dialout

Step 12: Continue on the document Toolchain Guide. You may also try

Update on Ubuntu

Step 1: Update of packages

sudo apt update && sudo apt upgrade

Step 2: HARDWARIO Firmware tool update

sudo pip3 install --upgrade --no-cache-dir bcf

Setup on Generic Linux

If you have other Linux distribution or unsupported Ubuntu version, we recommend to use official GNU Embedded Toolchain for ARM from developer.arm.com pages. This package is validated by ARM and tested by us.

Step 3: Go to ARM website and download Linux 64-bit package

Step 4: Extract package to filesystem, e.g. into /opt folder (available for all users, you will need root privileges) or into ~/.local/opt folder (available only for you)

Step 1: /opt version

1
2
3
4
cd <folder with package> # go to folder with downloaded file
sudo cp gcc-arm-none-eabi-6-*-update-linux.tar.bz2 /opt  # copy to destination folder
cd /opt  # go there
sudo tar xjf gcc-arm-none-eabi-6-*-update-linux.tar.bz2  # unpack file

Step 2: ~/.local/opt version

1
2
3
4
5
mkdir -p ~/.local/opt  # create folder
cd <folder with package> # go to folder with downloaded file
cp gcc-arm-none-eabi-6-*-update-linux.tar.bz2 ~/.local/opt  # copy to destination folder
cd ~/.local/opt  # go there
tar xjf gcc-arm-none-eabi-6-*-update-linux.tar.bz2  # unpack file

Step 6: Update PATH variable so you can use arm-none-eabi-* binaries directly

1
2
3
4
5
cd  # go to user home folder
# use your favorite editor and edit ".profile" file
# find line with PATH variable. e.g.:

    export PATH="$PATH:/…"

Caution

Please note that three dots (…) represents some text there.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# and add to your path to the end (/opt version):

export PATH="$PATH:/…:/opt/gcc-arm-none-eabi-6/bin"

# or (~/.local/opt version)

export PATH="$PATH:/…:~/.local/opt/gcc-arm-none-eabi-6/bin"

# if there is no PATH line, add it

export PATH="$PATH:/opt/gcc-arm-none-eabi-6/bin"

# or

export PATH="$PATH:~/.local/opt/gcc-arm-none-eabi-6/bin"

Step 7: Use your distribution package manager and install

  • Git

  • Python 3

  • dfu-util

Step 8: Install HARDWARIO Firmware Tool

sudo pip3 install --upgrade --no-cache-dir bcf

Step 9: Continue on the document Toolchain Guide. You may also try

Update on Generic Linux

Step 1: Update Toolchain

sudo ln -sf gcc-arm-none-eabi-6-<version>-update gcc-arm-none-eabi-6  # where <version> could be: 2017-q2

or

ln -sf gcc-arm-none-eabi-6-<version>-update gcc-arm-none-eabi-6  # where <version> could be: 2017-q2

Step 2: Update packages

  • Use your distribution package manager

  • HARDWARIO Firmware tool update:

sudo pip3 install --upgrade bcf

Integration with Visual Studio Code

Every HARDWARIO project contains .vscode configuration folder so you just open the project folder in Visual Studio Code and you’re ready to go.

We also suggest to install C/C++ Intellisense and debug extentsion from Microsoft.

In file .vscode/tasks.json there are some tasks which you can run by pressing Ctrl+P and typing task.

Task

Description

build

Build active project

clean

Clean active project

dfu

Flash compiled firmware with dfu-util to the Core Module

ozone

Run Ozone debugger which can be used with J-Link debugger

update

Update SDK folder/submodule to the latest version

Tip

Project make file allows quicker parallel compilation. This can be set in .vscode/tasks.json where you set "args": ["-j4"], parameter, where the number 4 is the number of your CPU cores.