Development Environment on ArchLinux

These instructions allow you to build PX4 (without RTPS) for NuttX targets, using an unsupported version of GCCE from the package manager. The instructions have been tested on Antergos (an Arch Linux based distribution) as it is easier to set up than Arch Linux. We hope to provide fully tested instructions with the supported toolchain in the near future.

Permissions

The user needs to be added to the group "uucp":

sudo usermod -a -G uucp $USER

Then log out and log in for changes to take effect.

Script-based Installation

This script installs the (unsupported) latest GCCE from the package manager. MicroRTPS is not built.

Once ArchLinux is installed you can use the docker script archlinux_install_script.sh to install all dependencies required for building PX4 firmware.

To install using this script, enter the following in a terminal:

wget https://raw.githubusercontent.com/PX4/containers/master/docker/px4-dev/scripts/archlinux_install_script.sh
sudo -s
source ./archlinux_install_script.sh

Manual Installation

Common Dependencies

To install the dependencies manually, enter the following lines into a terminal.

# Common dependencies for all targets
sudo pacman -Sy --noconfirm \
    base-devel make cmake ccache git \
    ninja python-pip tar unzip zip vim wget

# Install Python dependencies
pip install serial empy numpy toml jinja2

# Install genromfs
wget https://sourceforge.net/projects/romfs/files/genromfs/0.5.2/genromfs-0.5.2.tar.gz
tar zxvf genromfs-0.5.2.tar.gz
cd genromfs-0.5.2 && make && make install && cd ..
rm genromfs-0.5.2.tar.gz genromfs-0.5.2 -r

genromfs is also available in the Archlinux User Repository (AUR). To use this package, install yaourt (Yet AnOther User Repository Tool) and then use it to download, compile and install genromfs as shown:

  yaourt -S genromfs

GCCE Compiler

A GCC compiler is required to build for NuttX targets. Enter the command below to install the latest version from the package manager (unsupported).

# Compiler from package manager (unsupported)
sudo pacman -Sy --noconfirm \
    arm-none-eabi-gcc arm-none-eabi-newlib

The standard instructions for installing the official version are listed below (untested):

Execute the script below to install 5.4:

pushd .
cd ~
wget https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q2-update/+download/gcc-arm-none-eabi-5_4-2016q2-20160622-linux.tar.bz2
tar -jxf gcc-arm-none-eabi-5_4-2016q2-20160622-linux.tar.bz2
exportline="export PATH=$HOME/gcc-arm-none-eabi-5_4-2016q2/bin:\$PATH"
if grep -Fxq "$exportline" ~/.bash_profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
popd

Now restart your machine.

If using Debian Linux, run this command:

sudo dpkg --add-architecture i386
sudo apt-get update

Then install the 32 bit support libraries (this might fail and can be skipped if running a 32 bit OS):

sudo apt-get install libc6:i386 libgcc1:i386 libstdc++5:i386 libstdc++6:i386
sudo apt-get install gcc-4.6-base:i386

Troubleshooting

Check the version by entering the following command:

arm-none-eabi-gcc --version

The output should be something similar to:

arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.4.1 20160609 (release) [ARM/embedded-5-branch revision 237715]
Copyright (C) 2015 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.

If you get the following output, make sure you have the 32bit libs installed properly as described in the installation steps:

arm-none-eabi-gcc --version
arm-none-eabi-gcc: No such file or directory

results matching ""

    No results matching ""