Link Search Menu Expand Document

Build Applications for VOXL, VOXL 2 and RB5 Flight

This page describes how to build applications for VOXL using the same tools and techniques ModalAI builds the voxl-sdk with.

The voxl-docker project provides setup instructions for two docker images which provide build environments for the VOXL’s ARM applications processor and Hexagon SDSP. It also provides the “voxl-docker” script for easily launching these docker images. These two docker images are prerequisites for building the majority of open-source projects on https://gitlab.com/voxl-public

See Installing voxl-docker for instructions on installing and using these docker images.

voxl-cross for cross-compiling applications

VOXL and VOXL Flight building ARMv7 (32-bit) or ARMv8 (64-bit) applications-processor projects

The voxl-cross Docker is configured with the proper cross-compiler to compile ARMv7 (32-bit) and ARMv8 (64-bit) code for the VOXL platform. The majority of MPA projects are built in voxl-cross except where Qualcomm-specific 32-bit libraries are required in which case voxl-emulator is used.

VOXL 2 and RB5 Flight building ARMv8 (64-bit) applications-processor projects

The voxl-cross Docker is configured with the proper cross-compiler to compile ARMv8 (64-bit) code for the VOXL 2 and RB5 Flight platforms.

voxl-emulator for building applications-processor projects

We provide a Docker image in .tar format which contains the root file system that runs on VOXL itself. Through QEMU emulation and Docker, the ARM binaries in the VOXL rootFS can run on a desktop computer aiding development and speeding up compilation time. Anything that can be compiled onboard VOXL should be able to be compiled in voxl-emulator.

rb5-flight-px4-build-docker for VOXL 2 PX4 Development

Please see instructions for building PX4 for the VOXL 2 Flight DSP in the VOXL PX4 Developer Guide

voxl-hexagon for building hexagon DSP projects

VOXL and VOXL Flight

The voxl-hexagon docker image is based on the x86_64 Ubuntu Bionic docker image but additionally contains the Qualcomm Hexagon SDK 3.1 and an ARM cross compiler. For legal reasons these components must be downloaded from their respective sources by the user before building the docker image. However, we provide instructions and an install script here in this project.

VOXL 2

Pending

How to develop for different components of the SoC

How to build for CPU Applications Processor

VOXL uses a Snapdragon 821 with an ARMv8-A 64-bit Qualcomm® Kyro Quad Core CPU.

RB5 Flight and M0054 use a QRB5165 with an ARMv8 8-core mix of Cortex-A77 and Cortex-A55.

Background

VOXL uses a 64-bit linux kernel, however most of the core libraries on VOXL are 32-bit and are built using GCC4.9. Most applications running natively on VOXL have to be built with that same version of compiler. GCC4.9 toolchain that comes with VOXL is only capable of building 32-bit applications, however building and running 64-bit applications is still possible and recommended for maximum performance benefit. Most VOXL services have been migrated to 64-bit.

RB5 Flight and M0054 are 64-bit native, voxl-cross should be used for that development and only 64-bit binaries are supported. (MORE DETAILS NEEDED)

Follow the instructions to install voxl-docker and the voxl-cross docker image here.

Build 64-bit applications

The voxl-cross Docker can be used to cross-compile 64-bit applications using GCC 4.9

Alternatively, a 64-bit docker image, such as, arm64v8/ubuntu or arm64v8/ros can also build and run 64-bit application in a Docker container directly on VOXL.

Our recommended compiler flags for 64-bit are as follows - specifying fpu flags is optional :

-march=armv8-a

Examples:

TargetNameDescriptionLink
VOXL CPUlibmodal_pipeCore MPA library for data passing over posix pipes contains both 32-bit and 64-bit build scripts using voxl-crossSource

Build 32-bit applications on VOXL or using voxl-emulator docker

The https://docs.modalai.com/install-voxl-docker/ builds 32-bit applications and is easy to use for quick ports of existing applications. 32-bit applications are only needed if direct access to 32-bit hardware drivers are required (camera and IMU).

Our recommended compiler flags for 32-bit architecture are as follows. Note that it is very important to specify correct fpu flags, otherwise the NEON engine will not be used for floating-point computations, significantly slowing down floating-point math.

-march=armv7-a -mfloat-abi=softfp -mfpu=neon-vfpv4

How to build for DSP

There are two DSPs available for programming on VOXL (Snapdragon 821). The Applications DSP (aDSP) and the Sensors DSP (sDSP or SLPI)

The aDSP is a powerful digital signal processor to offload signal processing tasks from the CPU. It is most capable performing fixed-point computer vision compute offload.

The sDSP is well suited to work with I/O and has a real-time operating system QuRT.

Follow the instructions to install voxl-docker and the voxl-hexagon docker image here.

VOXL Examples

Examples of how to write code for the Applications DSP, Qualcomm® Hexagon™ 680 with HVX:

TargetNameDescriptionLink
VOXL aDSPversion-testSimple application to grab information from the aDSPGitLab
VOXL sDSPHello WorldSimple hello world application to build and run code on the sDSP processorGitLab
VOXL sDSPlibvoxl-ioTalk to serial ports through the sDSPGitLab

RB5 Flight / M0054 Examples

Examples of how to write code for the Qualcomm® Hexagon™ Sensors Low Power Island:

TargetNameDescriptionLink
RB5 Flight sDSPPX4PX4 Flight ControllerGithub

DSP Development Tools

mini-dm

mini-dm is a diag log tool for debugging the Hexagon DSP that comes with Hexagon SDK.

To configure on Ubuntu:

lsusb and find the Qualcomm entry. VOXL’s device ID is 05c6:901d Qualcomm, Inc.

Edit /etc/udev/rules.d/70-android.rules and add the following line: SUBSYSTEM=="usb",ATTRS{idVendor}=="05c6",ATTRS{idProduct}=="901d",MODE=="0666"

To run:

$ ./Qualcomm/Hexagon_SDK/3.3.3/tools/debug/mini-dm/Linux_Debug/mini-dm

How to build for GPU

Overview

VOXL contains an embedded Adreno 530 GPU with 256 ALUs. This GPU is exposed through both OpenCL 1.1 and OpenGLES 3.1. The GPU can be exploited for significant algorithmic acceleration for use cases like computer vision and deep learning.

RB5 Flight and M0054 contain an embedded Adreno 650 with 1024 ALUs at 600MHz.

Examples

Examples of how to write code for the Qualcomm® Adreno™ 530 GPU

TargetNameDescriptionLink
VOXL GPUHello CLSimple application showing how to interact with the GPU using OpenCLGitLab
VOXL GPUTensorFlow LiteUse TensorFlow Lite with OpenCL on VOXLDocs
VOXL GPUOpenCV Docker ARMv8 with OpenCL Code

Table of contents