VOXL 2 PX4 Developer and Build Guide
Where the VOXL 2 PX4 source lives, how it is built, and tools for I2C and DSP debugging.
Table of contents
Introduction
Since not all support for QRB5165 has been integrated into the mainline PX4 source code ModalAI maintains a fork of the project where our custom additions are kept. The intention is to eventually merge all of these customizations into the mainline PX4 source repository so that our fork will no longer be necessary other than for research and development purposes.
Main components
- The PX4 firmware lives in ModalAI’s fork of the main PX4 firmware repository. The
voxl-px4package version matches the fork tag it pins — see How PX4 is Packaged on VOXL 2. - The voxl-px4 project is a wrapper that includes the PX4 firmware as a git submodule. The main objectives are to provide packaging and installation support.
- The build environment for QRB5165 is encapsulated in a docker image. This docker includes an ARM64 toolchain from Linaro to build the code running on the applications processor and a Hexagon DSP toolchain to build the code running on the SDSP. The Hexagon SDK is only available directly from Qualcomm so instructions are provided to obtain the SDK and integrate it into the build environment docker image.
Links to source code
- voxl-px4 wrapper project which runs the main service across Linux and sDSP.
- Development Branch on ModalAI’s VOXL 2 PX4 Fork which has the latest source code for the PX4 1.18 build for VOXL 2 (SDK 1.8). The PX4 1.14 line used by SDK 1.6 and older is on the voxl-dev branch.
- Docker image to build PX4 for VOXL 2 and RB5 Flight sDSP and CPU
I2C debugging
i2cdetect
There are three external i2c buses available to the SLPI DSP (SDSP). In order to help troubleshoot devices attached to these buses the PX4 i2cdetect system command has been added to the build (As of v1.14.0-2.0.135). With this it is possible to scan each of the external buses to detect devices attached.
Disable the PX4 service, then power cycle the board:
systemctl disable voxl-px4Start PX4 from the command line in minimal mode:
MINIMAL_PX4=1 voxl-px4 -dAt the PX4 prompt, scan each bus:
qshell i2cdetect -b 1 qshell i2cdetect -b 2 qshell i2cdetect -b 4
VOXL 2 external i2c buses
- bus 1: “Magnetometer” i2c on J19, pins 4 and 5
- bus 2: i2c on J4
- bus 4: “Spare” i2c on J19, pins 7 and 8
DSP debugging
mini-dm
mini-dm is a diag log tool for debugging the shell output of the Hexagon DSP. mini-dm is a part of the Hexagon SDK.
To configure on Ubuntu:
Run lsusb on the host and find the Qualcomm entry. VOXL’s device ID is 05c6:901d Qualcomm, Inc.
Add the udev rule with the following command:
echo 'SUBSYSTEM=="usb",ATTRS{idVendor}=="05c6",ATTRS{idProduct}=="901d",MODE=="0666"' | sudo tee -a /etc/udev/rules.d/70-android.rules
Then reload the udev rules on the host, or power cycle VOXL:
sudo udevadm control --reload-rules && sudo udevadm trigger
To run mini-dm, extract the Hexagon SDK and run this on the host (the Ubuntu18 build also works on Ubuntu 24):
sdk/x.x.x/tools/debug/mini-dm/UbuntuXX/mini-dm
Then run PX4 DSP commands on VOXL, for example:
px4-qshell crsf_rc status
The output will show up in the mini-dm console
[08500/01] 51:17.578 0068:01: SDSP: [uORB] Marking DeviceNode(qshell_req) as advertised in process_remote_topic 0632 uORBManager.cpp
[08500/01] 51:17.580 0049:01: SDSP: [qshell] qshell gotten: crsf_rc status 0088 qshell.cpp
[08500/01] 51:17.580 0049:01: SDSP: [qshell] arg0 = 'crsf_rc' 0163 qshell.cpp
[08500/01] 51:17.580 0049:01: SDSP: [qshell] arg1 = 'status' 0163 qshell.cpp
[08500/01] 51:17.580 0049:01: SDSP: [crsf_rc] UART device: 7 0582 CrsfRc.cpp
[08500/01] 51:17.580 0049:01: SDSP: [crsf_rc] UART RX bytes: 43316 0583 CrsfRc.cpp
...