Here are the steps to build the firmware for the Mini Pix.
- Get the source code.
git clone https://github.com/ArduPilot/ardupilot.git
You could also get source code via git clone https://github.com/radiolinkW/ardupilot.git but it doesn’t have the Mini Pix board build def file at this time.
I’m not sure what the other differences in the code are, I didn’t run diff on them.
Don’t download the source code via the zip file. Do a clone or a check out. You’ll see why in the next step.
- Update the source sub modules.
git submodule update --init --recursive
Doing a git check out or clone does not get the source code sub modules and you need them. This is the command to get them.
You’ll get a message similar to “Missing waf submodule.” if you don’t run this step.
If you get source via a zip file, git can’t do an automatic submodule update. This is why you want to do a git clone or checkout rather than the zip file.
- Check that the Mini Pix hardware definition file is in your source code.
ls libraries/AP_HAL_ChibiOS/hwdef/mini-pix/* Should see hwdef.dat
- Check that waf has what it needs to do a Mini Pix build.
./waf list_boards Should see “mini-pix” in the list.
- Configure the Mini Pix build.
./waf configure --board minipix
This should run to completion without errors.
- Get the dependencies sorted out.
I ran my build on a Fedora box. The Ardupilot Linux build page gives this file for sorting out dependencies, but it is strictly for Ubuntu systems.
Nevertheless, it provides a list of packages that are necessary to do the build. This link also has some tips.
http://ardupilot.org/dev/docs/building-setup-linux.html#building-setup-linux
My machine was already set up for Arduino development. I ran the following commands nonetheless and had no dependency issues. The second file list is for the SITL build, btw.
dnf install python-argparse openocd flex bison libncurses5-dev autoconf texinfo libftdi-dev zlib1g-dev zip genromfs python-empy cmake cmake-data
dnf install libtool libxml2-dev libxslt1-dev python-dev python-pip python-setuptools python-matplotlib python-serial python-scipy python-opencv python-numpy python-pyparsing realpath
pip2 -q install -U future lxml pymavlink MAVProxy
Not all of these are valid Fedora packages. I ignored the ones that weren’t found.
- Now do the actual build.
./waf plane or ./waf copter
This should run to completion.
Build Summary
Build directory: /home/me/Downloads/radiolink/ardupilot/build/mini-pix
Target Text Data BSS Total
bin/arduplane 818084 3672 127948 949704
- Now upload the firmare image to the Mini Pix.
I connected the Mini Pix to my computer with a USB cable. My computer has the proper USB permissions and users set up from doing other Arduino development work. I think it finds the Mini Pix on /dev/ttyUSBACM0, IIRC.
./waf copter --upload
This should run to completion without errors.
./waf plane --upload
Waf: Entering directory `/home/me/Downloads/radiolink/ardupilot/build/mini-pix’
Checking for env.py
env added CHIBIOS_FATFS_FLAG=USE_FATFS=yes
[813/815] Linking build/mini-pix/bin/arduplane
[814/815] Generating bin/arduplane.apj
githash 032b4373f68bd6b50ef1062beea8cf0dd6112ff9 md5 3b1f639d4077b891cc94267c1e3a77bd
Created /home/me/Downloads/radiolink/ardupilot/build/mini-pix/bin/arduplane.abin
[815/815] Uploading build/mini-pix/bin/arduplane.apj
WARNING: You should uninstall ModemManager as it conflicts with any non-modem serial device (like Pixhawk)
Loaded firmware for 3,0, size: 821788 bytes, waiting for the bootloader…
If the board does not respond within 1-2 seconds, unplug and re-plug the USB connector.
Found board 3,0 bootloader rev 5 on /dev/serial/by-id/usb-Radiolink_PX4_BL_FMU_v4.x_0-if00
sn: 004b00383036510534373932
chip: 10076413
family: STM32F40x
revision: 2
flash 1032192
Erase : [====================] 100.0%
Program: [====================] 100.0%
Verify : [====================] 100.0%
Rebooting.
- Testing.
I haven’t flown with my Mini Pix yet, but it seems to run correctly. I had no issues getting GPS lock, connecting to MissionPlanner, etc. At first glance, all the data appears to be correct. Servos seems to move as they should too.
FYI, MissionPlanner runs surprisingly well on Fedora via ‘mono MissionPlanner.exe’. No wine needed. Details here: Running Mission Planner on Linux
Special thanks to @james_pattison for answering many questions during this process.
Edit: I don’t know how to fix the bold text above.