Skip to content

how to build flash and use hydrafw on linux

Benjamin Vernoux edited this page Jul 8, 2020 · 1 revision

How to build, flash and use hydrafw on Linux (Debian/Ubuntu):

Prerequisites for Linux:

cd ~
sudo apt-get install git dfu-util python putty
wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2
tar xjf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2
echo 'PATH=$PATH:~/gcc-arm-none-eabi-4_9-2015q3/bin' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/hydrabus/hydrafw_hydranfc_shield_v2.git hydrafw_hydranfc_shield_v2
cd ~/hydrafw_hydranfc_shield_v2
git submodule init
git submodule update
cd ./scripts
sudo python get-pip.py
sudo python -m pip install GitPython --upgrade
sudo python -m pip install intelhex --allow-external intelhex --allow-unverified intelhex
cd ..
  • For Debian / Ubuntu on 64bits/amd64 system see https://wiki.debian.org/Multiarch/HOWTO in order to enable multi architecture for i386 support.
  • When multiarch is enabled you shall also install libc6-i686:i386 (Debian) or libc6:i386 (Ubuntu)
Note: 
For get-pip.py if you need a proxy for internet access set following variables before to launch
python get-pip.py:
export http_proxy=http://proxy.myproxy.com
export https_proxy=https://proxy.myproxy.com
sudo -E python get-pip.py

Build hydrafw on Linux:

cd ~/hydrafw_hydranfc_shield_v2/src
make clean
make

In case of error during build like:

Traceback (most recent call last):
  File "../scripts/hydrafw-version.py", line 14, in <module>
    git=Repo(search_parent_directories=True).git
TypeError: __init__() got an unexpected keyword argument 'search_parent_directories'
make[1]: *** [hydrafw_version.hdr] Error 1

Just execute

sudo python -m pip install GitPython --upgrade

Then relaunch the build

Flash and use hydrafw on Linux:

See the Wiki Getting-Started-with-HydraBus-flash-and-use-hydrafw-on-linux

Alternative simplified way to Build & Flash hydrafw on Linux Debian (thanks to Mashu):

sudo su
apt-get install python-pip python git python-git dfu-util gcc-arm-none-eabi binutils-arm-none-eabi
pip install intelhex
git clone https://github.com/hydrabus/hydrafw_hydranfc_shield_v2
cd hydrafw_hydranfc_shield_v2/src
git submodule init
git submodule update
make
dfu-util -d 0483:df11 -a 0 -D build/hydrafw.dfu

LTO errors

There is a bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69866 and here https://bugs.launchpad.net/gcc-arm-embedded/+bug/1570613) that prevents ChibiOS to be compiled with ARM GCC in versions 5.x, 6.x and 7.x. If the build fails with a message like :

lto1: internal compiler error: in add_symbol_to_partition_1, at lto/lto-partition.c:xxx

Please downgrade your ARM GCC package to a 4.x version

Note: This issue shall be fixed with https://launchpad.net/gcc-arm-embedded/+milestone/8-2018-q4-major or more to be confirmed

Clone this wiki locally