Building ArduPilot for Pixhawk/PX4 on Windows with Make

Building ArduPilot for Pixhawk/PX4 on Windows with Make

  1. Install GitHub for Windows
  2. Ensure your github settings are set to leave line endings untouched.
    • The “Git Shell (or Bash)” terminal was also installed when you installed Git.  Click on your new “Git Shell (or Bash)” Icon and type in the following in the Git “MINGW32″ Terminal window:
    git config --global core.autocrlf false
  3. Clone the ardupilot, PX4Firmware and PX4NuttX repositories onto your machine:
  4. Download and install the PX4 toolchain by running thepx4_toolchain_installer_v13_win.exe
  5. Create and customise the config.mk file:
      • Start the PX4Console which can be found under Start >> All Programs >> PX4 Toolchain on Windows 7 machine or you can directly run C:\px4\toolchain\msys\1.0\px4_console.bat
      • “cd” to the directory where the ardupilot firmware was installed in step #3 and then into the ArduCopter directory (be sure to capitalise the “A” and “C” of ArduCopter).  In the example above the command would be:

    cd /c/Users/<username>/Documents/GitHub/ardupilot/ArduCopter

      • create the config.mk by typing the command below.  A message should be displayed saying “WARNING – A config.mk file has been written” including the exact location of the file

    make configure

      • If the PX4Firmware and PX4NuttX repositories were created using the exact name and location shown in Step #3 there should be no need to modify the config.mk file but if the name or location are different you will need to open the config.mk file in an editor such asNotePad++ and set the PX4_ROOT and/or NUTTX_SRC values to match.

        BuildingTheCode_PX4OnWindows2

  6. Build the firmware by opening a PX4 console and cd to ArduCopter directory, then enter one of the following commands to perform a build
      1. make px4                <– will build both PX4 and PixHawk firmware for a quadcopter
      2. make px4-v2           <– will build the Pixhawk firmware for a quad
      3. make px4-v2-hexa  <– build the Pixhawk firmware for a hexacopter (other supported suffixes include “octa” and “heli”)
      4. make clean             <– “clean” the ardupilot directory
      5. make px4-clean      <– “clean” the PX4Firmware and PX4NuttX directories so the next build will completely rebuild them
      6. make px4-v2-upload  <– build and upload the Pixhawk firmware for a quad (i.e. no need to do step #7 below)
      7. The firmware will be created in the ArduCopter directory with the .px4 file extension.

    PX4_ArduCopter_Build

  7. Upload the firmware using the Mission Planner’s Initial Setup >> Install Firmware screen’s “Load custom firmware” link

Hints for speeding up compile time

Anti virus protection is likely to slow the compile times especially for PX4 so it is recommended that the folders containing the ardupilot, PX4Firmware and PX4NuttX source code are excluded from your virus protections real-time scan.
The first scan after a “make px4-clean” will be very slow as it rebuilds everything


Questions about this page? Comments? Suggestions? Post to APM Forum! Use the platform specific to your query, and make sure to include the name of the page you are referring to.

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值