Waf ArduSub build not working - which board?

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?

Cheers,
K

Hi Karl,

Did you follow this instructions ?
https://www.ardusub.com/developers/developers.html

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

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!

Hi,

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

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!

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

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

Ok here’s mine: waf_build_fail - Pastebin.com

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

Please try to install
sudo apt install python-lxml

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

No go. Here’s the pastebin: waf_build_fail_2 - Pastebin.com

Hi Karl,

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

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!

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”…

1 Like

Thanks for following up @karlfernandes.

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!

1 Like

Hello,
I’m having difficulty building the firmware as well. I took the WSL path.
Heres the logs [build_firmware_px4fmu-v2] Error 2 - Codeshare
(i forked from arduSub repo and branched off from the 3.5 branch where I edited only the ap_motors)

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

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.

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