Build ArduCopter (v3.1) for Pixhawk using make

Hi,
How can I build ArduCopter v3.1 (inside ArduPlane-v2.75 folder) for pixhawk?
If I use the github.com/dijdrones/ardupilot/ArduCopter I have version 3.2, but I want version 3.1 of ArduCopter.
But if I replace the ArduCopter v3.2 in the original zipfile from github with the ArduCopter v3.1 it will not build for px4 (with ‘make px4’ etc…).

Can anyone explain how to do this?

I think you should be able to use these repositories:
github.com/diydrones/ardupilot/ … pter-3.1.0
github.com/diydrones/PX4Firmwar … pter-3.1.0
github.com/diydrones/PX4NuttX/r … pter-3.1.0

you’ll likely need to do:
make px4-clean

make px4-v2 <-- for pixhawk
OR
make px4-v1 <-- for original px4

Oke thank you very much! Those repositories were hidden from me without the correct URL.

This way I can build and flash version AC:3.1.0 for pixhawk.

Unfortunately I still cannot use version AC:3.1.0-rc5, because if I build this rc5 code with the PIXHAWK and NUTXX from the same repositories in your links I have problems… I will build and it will flash, but I cannot calibrate the compass (get’s no samples) and I cannot calibrate the accelerometer (“calibration failed”).

If you happen to know a simple fix for this, please tell, otherwise I’m happy with version 3.1.0 :wink:

I’ll also add your solution to my other posts spread across the internet :wink:
Thanks again!

Hmm, apparently I also have a lot of “BAD compass health”, “BAD GPS healt” problems…
I now switched to AC:3.1.2 (the latest, but from the repository in the link you send).
I’m guessing (and hoping) this version is the most stable of the v3.1 series…

Menno

I’ve switched to the newest stable AC version for pixhawk… and it’s working now

I have now edited the AC:v3.1.2 and build it for Pixhawk and flashed it and everything works.

Can I now also do HIL with this firmware? Because in the guides for HIL you always see that you have to upload the HIL firmware, but this of course not the code I want to test…

Menno

HIL does not work for copter since we made the HAL.

If you are interested, it would be great if you could create a HAL for HIL

This is the answer: You can get older versions (a.k.a. releases a.k.a. tags in github) by checking out these 3 links:

https://github.com/diydrones/ardupilot/releases
https://github.com/diydrones/PX4Firmware/releases
https://github.com/diydrones/PX4NuttX/releases

Always use matching versions of these three directories, if you don’t chances are it won’t compile (correctly). Indeed, as you can see not all ardupilot release come with a maching PX4Firmware and PX4NuttX release, so possibly not all ardupilot versions can be build for Pixhawk. (Correct me if I’m wrong).

If you use this guide http://dev.ardupilot.com/wiki/where-to-get-the-code/or http://dev.ardupilot.com/wiki/building-px4-with-make/ and the links in there, you’ll have the latest (developer) version, this might not be what you want. You for instance might want the latest stable release that MissionPlanner flashes to your Pixhawk when you select ArduCopter, -Plane, -Rover there. Checkout the version number of this stable release in MissionPlanner and look for this version in the three links above.

Enjoy :wink: