Home        Store        Docs        Blog

Waf ArduSub build not working - which board?

(Karl) #1

Hi there,

Just wondering if anyone has tried to compile/build ArduSub firmware with waf after the latest updates in ArduPilot which get rid of the px4-v2 board targets?

I’ve tested by changing the target to Pixhawk1 as recommended in the error message from ./waf configure --board px4-v2 command, and it appears to compile, build, upload to the pixhawk but then comms to QGC doesn’t work. I’m using Linux Ubuntu 16.04.

I’ve reflashed with the latest ArduSub (Sub ArduSub V3.5.3) directly using QGC and that is fine and everything works but I actually want to use waf though (or make but this is now deprecated) so I was wondering if anyone had any ideas?


(Patrick José Pereira) #2

Hi Karl,

Did you follow this instructions ?

Can you be more explicit about the QGC communication issue ?
Which QGC version are you using and which ArduSub branch are you building ?

(Karl) #3

Hey Patrick,

Yep followed those instructions but I think you’ll find that this line won’t actually work anymore with latest ardupilot (unless I’m doing something wrong which is possible):

QGC Communication issue: QGC never responds to the pixhawk (plugged directly in via microUSB) but just hangs on “waiting for vehicle” after my waf build

QGC Version: 3.2.4 Blue Robotics rev6

ArduSub branch: master

Thanks for your quick response!

(Patrick José Pereira) #4


Please do not build master branch, use Ardusub-stable.
As the documentation says:

Before compiling ArduSub, first checkout the stable version:
git fetch --tags
git checkout ArduSub-stable
git submodule update --recursive

(Karl) #5

Thanks Patrick.

I did try using the ArduSub-stable branch previously but hit an error. I’ve gone through the documentation from the beginning and checked everything and now hit this same error again…

Build failed
 -> task in 'px4_msg_gen' failed (exit status 2): 
{task 139624429093664: cmake_build_task  -> }
['/usr/bin/cmake', '--build', '/home/test_ardu/ardupilot/build/px4-v2/modules/PX4Firmware', '-- 
target', 'msg_gen']

Thanks again for you help!

(Jacob) #6

Please provide the entire output to these commands in pastebin:

git clone https://github.com/ardupilot/ardupilot \
&& cd ardupilot \
&& git fetch --tags \
&& git checkout ArduSub-stable \
&& git submodule update --init --recursive \
&& ./waf configure --board=px4-v2 \
&& ./waf sub

(Jacob) #7

Here’s mine: https://pastebin.com/XPTHD3dA (it works)

(Karl) #8

Ok here’s mine: https://pastebin.com/eVgEKzJ3

I’ll have a read through yours now but you might be quicker to spot what’s going on…

(Jacob) #9

Please try to install
sudo apt install python-lxml

(Karl) #10

Ok. And then rerun ./waf configure, build?

(Karl) #11

No go. Here’s the pastebin: https://pastebin.com/PiPxJa4e

(Patrick José Pereira) #12

Hi Karl,

To avoid any missing package, please run ./Tools/scripts/install-prereqs-ubuntu.sh inside your ardupilot folder, and try again.

(Karl) #13

Hi Patrick,

Thanks for your response. I’ve tried running this prereqs script and still no luck. I have also tried these instructions now on 3 different machines (though all ubuntu 16.04) and am still not able to build using waf…

On one of my laptops however it gets stuck at “Could not find the program [‘arm-none-eabi-ar’]” - so for some reason it’s not finding that gcc compiler. I’ve tried running . ~/.profile to log out/in but that doesn’t work.

Not sure what to try next but any suggestions welcome!

(Karl) #14

Hey so I managed to fix the path problem with
export PATH="$PATH: <path_to_arm-none-eabi-ar>"

For some reason the ./Tools/scripts/install-prereqs-ubuntu.sh doesn’t actually add the compiler to the path, even though it looks like it is meant to.

After a supposedly successful build I was unable to upload when I used ./waf --upload sub command because it would just hang at the “If your board doesn’t respond after 1-2seconds unplug and replug USB cable”…

(Jacob) #15

Thanks for following up @karlfernandes.

(Karl) #16

No problems @jwalser. Just to be clear I still couldn’t upload directly to the pixhawk using waf. Not sure what is going on now because it is just hanging. Decided to just upload the build using a different method though it would still be nice to use ./waf --upload sub to do it!

(Sakib Ahmed) #17

I’m having difficulty building the firmware as well. I took the WSL path.
Heres the logs https://codeshare.io/5Qqege
(i forked from arduSub repo and branched off from the 3.5 branch where I edited only the ap_motors)

(Sakib Ahmed) #18

This did not work for me either. Im on windows10 WSL.
This time i did no customization.


(Patrick José Pereira) #19

Hi Sakib,

Are you running the WSL with Ubuntu or with other OS ?

  • Try to run the install-prereqs-* script.
    It appears that you are using the wrong arm-none-eabi-g++ version, tries with 4.9.

(Satyam Ambast) #20

Hey Patrick,
I believe I’m running into the same problem as Sakib. I have run the prereqs script already but still the arm-none-eabi-g++ version that is used while building is not 4.9. Could you help out in how to correct this? I’m using Ubuntu 18.04 LTS