The main difference between Windows and other supported operating systems is that Windows does not provide a bash environment like other systems do. We prepackaged most of tools to make the installation as friendly as possible. All you need to install manually is the msysGit package. Then you run two scripts and should have complete build environment ready. More info about the OpenPilot build system.
Tutorial video walk through explaining process of setting up Git Bash and building GCS software.
Install required software
Download and install msysGit version control system using default options except the path to install:
By default, the installer suggests to install it into C:\Program Files\Git or C:\Program Files (x86)\Git. In this case you will later have weird errors like "File not found: C:\Program". This is a known limitation.
Use default settings
By default, the installer suggest the 1st option - Use Git Bash only (no git in the PATH). If you only want to use command line builds, you may keep that option. Optionally you can choose the 2nd option, then git will be added to the PATH. It may be desired if you later want to install Qt Creator IDE and want to build GCS from it.
Use default settings
Open Git Bash window using Start menu or Windows explorer context menu.
Clone the OpenPilot repository into a path without spaces for example: C:\code\OpenPilot.
Check out the "next" source code branch:
Install Windows version of make utility:
Install toolchains used to build the software:
When the process finishes, you should have all tools to build OpenPilot software:
If all went well, you may optionally remove downloaded toolchain distribution files to free up some disk space:
Build the OpenPilot software
To build absolutely all - firmware (including bootloaders, bootloader updaters, flight firmware), Ground Control Station (GCS) and Windows installer package - just type:
It will build the UAVObjGenerator utility:
Then GCS, including automatically generated UAVObject source files (created by UAVObjGenerator):
And finally the Windows installer:
All will be built in the build sub-directory.
The GCS software will be placed into the build/openpilotgcs_release sub-directory. The firmware is embedded into the GCS code, but also can be found in the build sub-directory in corresponding folders.
And the Windows installer can be found in the build sub-directory:
Congratulations! You have built the complete OpenPilot software suite!
More build hints
tools/bin/make every time? Create a new directory called bin in your profile folder.
Copy make.exe from tools/bin sub-directory of your OpenPilot folder to the
bin folder you just created.
This folder is in the PATH already, then you may use just
Complete list of available make targets is available by using make help. You can build anything you want. The build system will automatically build all prerequisites if necessary.
If you have enough RAM (5-6GB or more) and multi-core CPU, you may build the software using parallel builds. To do so add -j option to the make command line:
In this case you may build all in 5-10 minutes.
Use clean_package target if you want to rebuild all from scratch:
Finally, to remove all build results use:
Due to automated toolchain installation, the install and build process should be straightforward. But if it fails, you should save build logs and ask for help on the OpenPilot forum in this thread.
- Use V=1 make command line option. It provides more verbose output including command lines and full paths.
- Use clean_package target. It removes the build directory first, so gets rid of such problems as wrong paths in object files or broken dependencies.
- Save complete build log to a file using redirection of standard output and standard error streams. Then the log can be posted on forums.
This is the recommended command line for troubleshooting:
In the example above we build clean package (that is, build directory will be removed before build) using verbose output (V=1), sending standard error stream to the standard output stream (2>&1) and making a copy of both in make_log.txt text file using pipe. Note that use -j for troubleshooting is probably a bad idea.
As you may notice, V=1 adds a lot of useful for troubleshooting info which the rest of command line copies to a text file: