PXFmini Builds are not compiling correctly

I want to upgrade to a later version of Ardupilot. It seems many compiled binaries are not working for my board, erle pxfmini.

The file size is small (1,000 KB) or so, on the server builds, and also on my local machine.

I can help to fix this, but I would need some guidance to help get this working.


Hi @WaveRep - some indication of why they’re not working would be good :slight_smile:

I’m guessing you’re saying that the upgrade flashing process is failing because the image is too large? Can you paste a screenshot or text of the failure?

I will post more logs when I am able to get back on my pxfimini later.


The filesize here is under the expected file size of an .elf we would expect for a Copter compiled file. – This, along with others, do not work.

How are you using the ELF binary?

When I try to run any version of them on the attached Raspberry PI I get a seg fault.

Take a look at this, there is valuable info available on this thread.

1 Like

That’s very helpful, thanks.

I’ve built arducopter for the PXFMini successfullyon Ubuntu, but it won’t run on the Pi Zero, I’m getting a seg fault.

I think it’s a mismatch between versions. I’ve been unable to get any of the new, Ubuntu APSync images to boot on the PI, see Ubuntu T265 images do not boot on Pi Zero

So I’ve been using the Raspbian based build at New APSync Build for Raspberry Pi

Looking at the environment setup script in the build I think I have all the pre-requisites installed, waf runs and configures the build successfully, but the build itself ./waf copter waits a few minutes then fails.

Waf: Entering directory `/home/pi/src/build/pxfmini'
Waf: Leaving directory `/home/pi/src/build/pxfmini'
Build failed
Traceback (most recent call last):
  File "/home/pi/src/modules/waf/waflib/Runner.py", line 395, in task_status
    return tsk.runnable_status()
  File "Tools/ardupilotwaf/git_submodule.py", line 75, in runnable_status
    out = self.generator.bld.cmd_and_log(cmd, quiet=Context.BOTH, cwd=self.cwd)
  File "/home/pi/src/modules/waf/waflib/Context.py", line 461, in cmd_and_log
    raise e
WafError: Command ('/usr/bin/git', 'submodule', 'status', '--recursive', '--', '/home/pi/src/modules/gtest') returned 128

Ideally I’d like to use the official APSync images which I’m guessing would allow me to use the pre-build pxfmini binary or cross compile on my Ubuntu machine, but I can’t, and I can’t seem to get the PI to build the pxfmini binary either, so I’m a little stuck.

Any help from either direction would be appreciated.

Latest version? How big was the compiled version on your side?

That error also looks like a git specific error trying to import the libraries/submodules.

If you have a few moments, can you share how far you got with (latest) ardupilot master and running it on a pi / pxfmini (or equivalent/similar) hardware?

Well, i’s been a long time since I used the pxfmini but I recently rebuilded it in my series of blogs on swarming

There are many thiings to consider when you build a linux based FC. first you need a RT Kernel that is better suited to near real time processing. I haen’t tried to build since Kernel release 5.x , but you can look at it:

Second, to make the binary , you have to get the correct cross-compiler suited with the correct broadcom chip (either Pi Zero or Pi 3 or 4). Then you can build using WAF command and specify the correct platform.

For testing, it is best to just copy the bin file to home directory and launch it manually using the correct mapping to the serial ports

I am able to compile on a Debian VM https://github.com/erlerobot/ardupilot/ their old version, and have ti run on a Pi Zero W with PXFMini or breadboard with components. This is done using make.

I am unable to compile latest master either on a Debian VM or within the board itself using waf Actually, it compiles, but the file is very small (1-2 MB) compared with the usual 12MB, and does not run as it segfaults (and probably is missing a bunch of dependencies since the file size is not what i expect). This is the same behavior as what ardupilot master builds on the server daily for pxfmini.

Yes I agree regarding bin flies and relaunching it - I’m aware of that. I will look through your posts again. Hopefully lospalos returns to the forum and he can give any insight :slight_smile:

@MHefny can you give your input on this issue ?

Hi do you mean this fix ?

@MHefny I have tried your guide, to build a binary and I get a segmentation fault. Are you able to tell me what version of Raspbian you were on?

@ppoirier I’ve tried again and have not had any recent luck. I did get past the git submodule and the issue with future, as I’ve privvy to those issues. When you built and ran, what version of raspbian were you on? I’m on Jessie, same image as Erle PXFMINI OS.

I am able to compile, it just doesn’t run and it segfaults after I run the compiled binary file. I’ve built compiled binaries for Pixhawk, original APM, and original PXFMINI builds. I haven’t had this kind of trouble, I feel like it is very close! @lospalos hopefully responds soon :slight_smile: as he got to a recent version, but knowing what version of his VM and his gcc settings, and what version of his raspbian are very important.

If I’m able to get this solved, I’m happy to provide my findings for future people who still are stuck with PXFMINI or a pi-zero board.

I’ve compiled your branch and the latest master, and I’m certain those commits are included and I’m still having issues.

I use raspberry zero you need to compile it with raspberry zero c compiler not any arm compiler.
I downloaded cross compiler for raspberry zero and used it.

./waf configure --toolchain=/opt/cross-pi-gcc/bin/arm-linux-gnueabihf --board

./waf rover
./waf copter