Skip to content

Latest commit

 

History

History
378 lines (245 loc) · 11.4 KB

toolchain-setup.md

File metadata and controls

378 lines (245 loc) · 11.4 KB

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.

{% hint style="info" %} 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. {% endhint %}

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 BigClown 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

{% hint style="warning" %} You will need administrator rights to install. {% endhint %}

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

Download from GitHub

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

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

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

Step 5: After finishing the installation, lauch the BigClown 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)

{% hint style="info" %} The advantage of the context menu is to open the BigClown Toolchain directly in the directory location you need to work with. {% endhint %}

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:

Setup on macOS

{% hint style="warning" %} The following procedure has been tested on macOS 10.12. {% endhint %}

Step 1: Open the Terminal application

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

{% hint style="info" %} Homebrew is the package management system and the ecosystem of packages for macOS. {% endhint %}

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 BigClown 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

  • Update of packages:
brew update && brew upgrade
  • BigClown Firmware tool update:
sudo pip3 install --upgrade --no-cache-dir bcf

Setup on Ubuntu

{% hint style="warning" %} The following procedure has been tested on Ubuntu 20.04 LTS. {% endhint %}

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 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 5: Update the index of the available packages

sudo apt update

Step 6: Install common software properties

sudo apt-get install software-properties-common

Step 7: Install compiler & necessary tools

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

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

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

Step 9: Install BigClown Firmware Tool

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

Step 10: Add user to dialout group

sudo adduser $USER dialout

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

Update on Ubuntu

  • Update of packages:
sudo apt update && sudo apt upgrade
  • BigClown 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 1: Go to https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads and download Linux 64-bit package

Step 2: 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

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 3: ~/.local/opt version

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 3: Create a symbolic link gcc-arm-none-eabi-6

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

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

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

    export PATH="$PATH:/…"

{% hint style="warning" %} Please note that three dots (…) represents some text there. {% endhint %}

# 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 5: Use your distribution package manager and install

  • Git
  • Python 3
  • dfu-util

Step 6: Install BigClown Firmware Tool

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

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

Update on Generic Linux

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
  • Update packages
    • Use your distribution package manager
  • BigClown Firmware tool update:
sudo pip3 install --upgrade bcf

Integration with Visual Studio Code

Every BigClown 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+Pand typing task.

ask 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

{% hint style="info" %} 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. {% endhint %}

Integration with J-Link debugger

To debug the running code on Core Module you can use Ozone debugger with J-Link debug probe. It is also possible to use GDB/OpenOCD with other debug probes but this is not documented yet.

Download the Ozone debugger.

{% hint style="info" %} For Windows users: Ozone folder also needs to be set in PATH environment variable or you can simply edit Makefile and set absolute path to the Ozone.exe file. It is also possible to open project directly in Ozone, please see the options below. {% endhint %}

How to start debugging the project:

  • In the command line by typing make ozone
  • In Visual Studio Code by pressing F5 or Ctrl+P and typing task ozone
  • In Ozone by loading project configuration file sdk/tools/ozone/ozone.jdebug.

Related Documents