Skip to content

OpenTX 2.1 Linux Build Instructions

Arne Schwabe edited this page Sep 13, 2017 · 2 revisions

The following instructions describe how to set up the build environment, retrieve the source code and lastly build OpenTX on a Linux machine. Instructions have been made for and and tested on Fedora 20 and Mint 16, since these distributions use different package handlers.

Fedora is the official build environment.

On Fedora

To start with a number of tools and libraries have to be installed. Install them by executing the following command line:

yum install git gcc gcc-c++ avr-gcc-c++ PyQt4 fox-devel avr-libc  

This is what you need to install to build all transmitter simulators and binaries for the 9x and 9xr radios on Fedora.

On Debian / Ubuntu / Linux Mint

sudo apt-get install gcc gcc-avr avr-libc build-essential libfox-1.6-dev python-qt4

This is what you need to install to build all transmitter simulators and binaries for the 9x and 9xr radios on Linux Mint (and probably also on Debian/Ubuntu).

###Updated ARM Toolchain Information For Ubuntu Now there is working version gcc-arm-none-eabi in ubuntu 16.04LTS, just install it too

sudo apt-get install gcc-arm-none-eabi

Then you can build Taranis bin file using make PCB=TARANIS

Additional tools for ARM radios/boards

If you want to build firmware for ARM equipped radios and boards, like the Taranis you will need to install the arm-none-eabi-gcc tool chain. You can not install the default Fedora version available via yum, since the resulting binaries will not work in the Taranis.

The easiest way to install a working arm tool chain is to fetch a package from launchpad.net: https://launchpad.net/gcc-arm-embedded.

Which package version should I use?

The compiler we use on the compilation server is now the 4_7-2014q2

In December 2013 version 4.8 of the package was released and this version caused problems on Linux Mint. The build failed. A temporary solution was to keep using 4.7 from September 2013. Since then people have reported success using version 4.8 of the package on Mint and there are no known issues on Fedora. The instructions below are for the 4.7 version.

Go to https://launchpad.net/gcc-arm-embedded and look for a file called gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2. Download it.

Unpack the file and move the content to whichever directory you want to keep it in. Some good alternatives are /opt/ and /usr/local/. Then add the installation location to the your PATH variable, so that the binaries are found during compilation. The following commands does exactly that:

tar xjvf gcc-arm-none-eabi-4_7-2013q3-20130916-linux.tar.bz2  
sudo mv gcc-arm-none-eabi-4_7-2013q3 /opt/ARM  
echo "PATH=$PATH:/opt/ARM/bin" >> /home/"$(whoami)"/.bashrc  
source /home/"$(whoami)"/.bashrc

Check that the path works by checking the version of the installed software

arm-none-eabi-gcc --version

If you are using a 64 bit Linux you will get the following error message:

-bash: /opt/arm-2013.05/bin/arm-none-eabi-gcc: No such file or directory

The reason is that the ARM tool chain is 32-bit. For 64 bit system, 32 bit libc and libncurses are required to run the ARM tools. Installing these 32-bit libraries on 64-bit Linux is outside of the scope of this tutorial.

Here is a link to get you going: How to use the Mentor Graphics Sourcery ARM toolchain on 64-bit Debian Wheezy

A better option is probably to install an alternative build of the 64 bit ARM tool chain. The source for the tools are the same, it is just the packaging that differs. There are reports of this method working, but it has not been tested by the OpenTX team: [Alternative ARM toolchain] (https://launchpad.net/~terry.guo/+archive/gcc-arm-embedded)

When you have installed the needed libraries, or if you are on a 32-bit Linux system, you should get the following version info:

arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.7.4 20130913 (release) [ARM/embedded-4_7-branch revision 202601]
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

You are now able to build also Taranis binaries.

Prepare the source code

Navigate to wherever you want to store the source code. Issue the following command (it will take quite a while to complete):

git clone https://github.com/opentx/opentx

Git has now built a cloned OpenTX repository for you. The first thing you should do is to select which branch of the repository you want to use.
If you want the latest stable release you should check out master:

cd opentx
git checkout master

If you want the bleeding edge development you should check out next:

cd opentx
git checkout next

Build OpenTX Firmware

Move to radio/src directory an execute make from there. Use appropriate make options to build desired version of OpenTX firmware.

Command Note
make This builds in a loadable 9x binary file (opentx.bin) with default selections
make PCB=TARANIS This builds a loadable Taranis binary file
make simu This results in an executable 9x simulator that can be started on the PC. To start it enter ./simu
make simu TRANSLATIONS=SE This results in an executable 9x simulator with Swedish texts that can be started on the PC. Enter ./simu to start it
make simu PCB=TARANIS This results in an executable Taranis simulator that can be started on the PC. To start it enter ./simu
make clean Remove compiled files and directories. Good to use when you have messed something up and want a clean start

Play around with the different build options. You find them listed in the OpenTX Compilation Options page.

Clone this wiki locally