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:
{% hint style="warning" %} You will need administrator rights to install. {% endhint %}
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
- 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
- Download and install the new version according to the chapter Setup on Windows.
Uninstall Apps & features:
{% hint style="warning" %} The following procedure has been tested on macOS 10.12. {% endhint %}
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 %}
brew tap armmbed/formulae
brew install armmbed/formulae/arm-none-eabi-gcc
brew install git
brew install dfu-util
brew install python3
sudo pip3 install --upgrade --no-cache-dir pip
sudo pip3 install --upgrade --no-cache-dir bcf
Step 9: Continue on the document Toolchain Guide. You may also try
- Update of packages:
brew update && brew upgrade
- BigClown Firmware tool update:
sudo pip3 install --upgrade --no-cache-dir bcf
{% hint style="warning" %} The following procedure has been tested on Ubuntu 20.04 LTS. {% endhint %}
wget http://mirrors.kernel.org/ubuntu/pool/main/i/isl/libisl15_0.16.1-1_amd64.deb
sudo dpkg -i libisl15_0.16.1-1_amd64.deb
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
sudo apt update
sudo apt-get install software-properties-common
sudo apt install gcc-arm-embedded git dfu-util python3 python3-pip python3-setuptools
sudo pip3 install --upgrade --no-cache-dir pip
sudo pip3 install --upgrade --no-cache-dir --ignore-installed bcf
sudo adduser $USER dialout
Step 9: Continue on the document Toolchain Guide. You may also try:
- Update of packages:
sudo apt update && sudo apt upgrade
- BigClown Firmware tool update:
sudo pip3 install --upgrade --no-cache-dir bcf
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)
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
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
sudo ln -s gcc-arm-none-eabi-6-<version>-update gcc-arm-none-eabi-6 # where <version> could be: 2017-q2
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"
- Git
- Python 3
- dfu-util
sudo pip3 install --upgrade --no-cache-dir bcf
Step 7: Continue on the document Toolchain Guide. You may also try
- Update Toolchain
- Download updated Linux 64-bit package from https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
- Extract it into proper folder (
/opt
,~/.local/opt
or other) - Update symbolic link
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
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+P
and 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 %}
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
orCtrl+P
and typingtask ozone
- In Ozone by loading project configuration file
sdk/tools/ozone/ozone.jdebug
.