Linux Installation Instructions for Arch and CentOS

USB Device Configuration

Linux users need to explicitly allow access to the USB bus for JTAG programming adapters.

For Archlinux: replace the group plugdev with uucp in the following commands

Run a simple ls in sudo mode to ensure the commands below succeed:

sudo ls

Then with sudo rights temporarily granted, run this command:

cat > $HOME/rule.tmp <<_EOF
# All 3D Robotics (includes PX4) devices
SUBSYSTEM=="usb", ATTR{idVendor}=="26AC", GROUP="plugdev"
# FTDI (and Black Magic Probe) Devices
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", GROUP="plugdev"
# Olimex Devices
SUBSYSTEM=="usb",  ATTR{idVendor}=="15ba", GROUP="plugdev"
_EOF
sudo mv $HOME/rule.tmp /etc/udev/rules.d/10-px4.rules
sudo /etc/init.d/udev restart

User needs to be added to the group plugdev:

sudo usermod -a -G plugdev $USER

Installation Instructions for Uncommon Linux Systems

CentOs

The build requires Python 2.7.5. Therefore as of this writing Centos 7 should be used. (For earlier Centos releases a side-by-side install of python v2.7.5 may be done. But it is not recommended because it can break yum.)

The EPEL repositories are required for openocd libftdi-devel libftdi-python

wget https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
sudo yum install epel-release-7-5.noarch.rpm
yum update
yum groupinstall “Development Tools”
yum install python-setuptools
easy_install pyserial
easy_install pexpect
yum install openocd libftdi-devel libftdi-python python-argparse flex bison-devel ncurses-devel ncurses-libs autoconf texinfo libtool zlib-devel cmake

Note:You may want to also install python-pip and screen

Additional 32 bit libraries

Once the arm toolchain is installed test it with:

arm-none-eabi-gcc --version

If you receive the following message

bash: gcc-arm-none-eabi-4_7-2014q2/bin/arm-none-eabi-gcc: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

Then you will also need to install other 32-bit libraries glibc.i686 ncurses-libs.i686

sudo yum install glibc.i686 ncurses-libs.i686

Pulling in ncurses-libs.i686 will pull in most of the other required 32 bit libraries. Centos 7 will install most all the PX4 related devices without the need for any added udev rules. The devices will be accessible to the predefined group ' dialout'. Therefore any references to adding udev rules can be ignored. The only requirement is that your user account is a member of the group 'dial out'

Arch Linux

Ensure you have the multilib repository enabled.

sudo pacman -S base-devel lib32-glibc git-core python-pyserial zip

Install yaourt, the package manager for the Arch User Repository (AUR).

Then use it to download, compile and install the following:

yaourt -S genromfs python-empy

Permissions

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

sudo usermod -a -G uucp $USER

After that, logging out and logging back in is needed.

Log out and log in for changes to take effect! Also remove the device and plug it back in!**

Toolchain Installation

Execute the script below to either install GCC 4.9 or 5.4:

GCC 4.9:

pushd .
cd ~
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 -jxf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2
exportline="export PATH=$HOME/gcc-arm-none-eabi-4_9-2015q3/bin:\$PATH"
if grep -Fxq "$exportline" ~/.bash_profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
popd

GCC 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

and 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

Ninja Build System

Ninja is fast than Make and the PX4 CMake generators support it. Unfortunately Ubuntu carries only a very outdated version at this point. To install a recent version of Ninja, download the binary and add it to your path:

mkdir -p $HOME/ninja
cd $HOME/ninja
wget https://github.com/martine/ninja/releases/download/v1.6.0/ninja-linux.zip
unzip ninja-linux.zip
rm ninja-linux.zip
exportline="export PATH=$HOME/ninja:\$PATH"
if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
. ~/.profile

Troubleshooting

Version Test

Enter:

arm-none-eabi-gcc --version

The output should be something similar to:

arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.7.4 20140401 (release) [ARM/embedded-4_7-branch revision 209195]
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.

If you get:

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

make sure you have the 32bit libs installed properly as described in the installation steps.

results matching ""

    No results matching ""