Development Environment on Linux

We have standardized on Debian / Ubuntu LTS as the supported Linux distribution, but boutique distribution instructions are available for Cent OS and Arch Linux.

Permission Setup

Warning Never ever fix permission problems by using 'sudo'. It will create more permission problems in the process and require a system reinstallation to fix them.

The user needs to be part of the group "dialout":

sudo usermod -a -G dialout $USER

And then you have to logout and login again, as this is only changed after a new login.

Installation

Update the package list and install the following dependencies for all PX4 build targets. PX4 supports four main families:

Info Install the Ninja Build System for faster build times than with Make. It will be automatically selected if installed.

sudo add-apt-repository ppa:george-edison55/cmake-3.x -y
sudo apt-get update
sudo apt-get install python-argparse git-core wget zip \
    python-empy qtcreator cmake build-essential genromfs -y
# simulation tools
sudo apt-get install ant protobuf-compiler libeigen3-dev libopencv-dev openjdk-8-jdk openjdk-8-jre clang-3.5 lldb-3.5 -y

NuttX based hardware

Ubuntu comes with a serial modem manager which interferes heavily with any robotics related use of a serial port (or USB serial). It can deinstalled without side effects:

sudo apt-get remove modemmanager

Update the package list and install the following dependencies. Packages with specified versions should be installed with this particular package version.

sudo apt-get install python-serial openocd \
    flex bison libncurses5-dev autoconf texinfo build-essential \
    libftdi-dev libtool zlib1g-dev \
    python-empy  -y

Make sure to remove leftovers before adding the arm-none-eabi toolchain.

sudo apt-get remove gcc-arm-none-eabi gdb-arm-none-eabi binutils-arm-none-eabi gcc-arm-embedded
sudo add-apt-repository --remove ppa:team-gcc-arm-embedded/ppa

Then follow the toolchain installation instructions to install the arm-none-eabi toolchain version 4.9 or 5.4 manually.

Snapdragon Flight

Toolchain installation

sudo apt-get install android-tools-adb android-tools-fastboot fakechroot fakeroot unzip xz-utils wget python python-empy -y
git clone https://github.com/ATLFlight/cross_toolchain.git

Get the Hexagon SDK 3.0 from QDN: https://developer.qualcomm.com/download/hexagon/hexagon-sdk-v3-linux.bin

This will require a QDN login. You will have to register if you do not already have an account.

Now move the following files in the download folder of the cross toolchain as follows:

mv ~/Downloads/hexagon-sdk-v3-linux.bin cross_toolchain/downloads

Install the toolchain and SDK like this:

cd cross_toolchain
./installv3.sh
cd ..

Follow the instructions to set up the development environment. If you accept all the install defaults you can at any time re-run the following to get the env setup. It will only install missing components.

After this the tools and SDK will have been installed to "$HOME/Qualcomm/...". Append the following to your ~/.bashrc:

export HEXAGON_SDK_ROOT="${HOME}/Qualcomm/Hexagon_SDK/3.0"
export HEXAGON_TOOLS_ROOT="${HOME}/Qualcomm/HEXAGON_Tools/7.2.12/Tools"
export PATH="${HEXAGON_SDK_ROOT}/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf_linux/bin:$PATH"

Load the new configuration:

source ~/.bashrc

Sysroot Installation

A sysroot is required to provide the libraries and header files needed to cross compile applications for the Snapdragon Flight applications processor.

The qrlSDK sysroot provies the required header files and libraries for the camera, GPU, etc.

Download the file Flight_3.1.1_qrlSDK.zip and save it in cross_toolchain/download/.

cd cross_toolchain
unset HEXAGON_ARM_SYSROOT
./qrlinux_sysroot.sh

Append the following to your ~/.bashrc:

export HEXAGON_ARM_SYSROOT=${HOME}/Qualcomm/qrlinux_v3.1.1_sysroot

Load the new configuration:

source ~/.bashrc

For more sysroot options see Sysroot Installation

Update ADSP firmware

Before building, flashing and running code, you'll need to update the ADSP firmware.

References

There is a an external set of documentation for Snapdragon Flight toolchain and SW setup and verification: ATLFlightDocs

Messages from the DSP can be viewed using mini-dm.

${HEXAGON_SDK_ROOT}/tools/debug/mini-dm/Linux_Debug/mini-dm

Note: Alternatively, especially on Mac, you can also use nano-dm.

Raspberry Pi hardware

Developers working on Raspberry Pi hardware should download the RPi Linux toolchain from below. The installation script will automatically install the cross-compiler toolchain. If you are looking for the native Raspberry Pi toolchain to compile directly on the Pi, see here

git clone https://github.com/pixhawk/rpi_toolchain.git
cd rpi_toolchain
./install_cross.sh

You will be required to enter your password for toolchain installation to complete successfully.

You can pass a different path to the installer script if you wouldn't like to install the toolchain to the default location of /opt/rpi_toolchain. Run ./install_cross.sh <PATH>. The installer will automatically configure required environment variables as well.

Finally, run the following command to update the evironmental variables:

source ~/.profile

Parrot Bebop

Developers working with the Parrot Bebop should install the RPi Linux Toolchain. Follow the description under Raspberry Pi hardware.

Next, install ADB.

sh sudo apt-get install android-tools-adb -y`

Finishing Up

Now continue to run the first build!

results matching ""

    No results matching ""