Copter-4.0.4 compile error

I’m building Copter-4.0.3 using Cygwin on Windows 10.
I downloaded ‘’ file from ‘’.

I’v got error message below, when I typed ‘./waf copter’

$ ./waf copter
Waf: Entering directory `/cygdrive/d/01_Dron/20_Ardupilot/01_FW_Ardu/ardupilot-Copter-4.0.3/build/fmuv3’
Embedding file sandbox.lua:libraries/AP_Scripting/scripts/sandbox.lua
Embedding file io_firmware.bin:Tools/IO_Firmware/iofirmware_lowpolh.bin
Embedding file bootloader.bin:/cygdrive/d/01_Dron/20_Ardupilot/01_FW_Ardu/ardupilot-Copter-4.0.3/Tools/bootloaders/fmuv3_bl.bin
Checking for
env added HAL_WITH_UAVCAN=1
env added PROCESS_STACK=0x2000
env added MAIN_STACK=0x400
env added IOMCU_FW=0
env added PERIPH_FW=0
env added BOARD_FLASH_SIZE=2048
env appended CPU_FLAGS=[’-mcpu=cortex-m4’, ‘-mfpu=fpv4-sp-d16’, ‘-mfloat-abi=hard’, ‘-u_printf_float’]
env added APJ_BOARD_ID=9
env added APJ_BOARD_TYPE=STM32F427xx
env added USBID=0x0483/0x5740
env added CHIBIOS_BUILD_FLAGS=USE_FATFS=yes CHIBIOS_STARTUP_MK=os/common/startup/ARMCMx/compilers/GCC/mk/ CHIBIOS_PLATFORM_MK=os/hal/ports/STM32/STM32F4xx/ MCU=cortex-m4 ENV_UDEFS=-DCHPRINTF_USE_FLOAT=1
Command [’/usr/bin/git’, ‘rev-parse’, ‘–short=8’, ‘HEAD’] returned 128

I couldn’t any solution through googling…
In this case, What can I do?


You will find the answer by following the wiki instruction !
The issue you have is just that you take a zip from github and not use git to get the code. We are using git on the build phase, so it is mandatory !

1 Like

Are you trying to build this outside of a git tree? That’s won’t work too

Try running “/usr/bin/git rev-parse --short=8 HEAD” in the root directory
of the ArduPilot tree and paste the results.

Hello, peterbarker. Thank you for your reply.

Yes, I’m building like you said(outside of a git tree)
I got value, after typed “/usr/bin/git rev-parse --short=8 HEAD”

이주성@DESKTOP-QQUOFPP /cygdrive/d/01_Dron/20_Ardupilot/01_FW_Ardu/ardupilot-Copter-4.0.3
$ /usr/bin/git rev-parse --short=8 HEAD

So, the results value is 0aa5d5c8.
How to paste? or Where to paste?
I hope your reply again. Thank you

Hi khancyr.
I couldn’t find good way on ardupilot site because I’m starter…
Ardupilot site show how to build from latest Code.
I think there is no way to build using ‘*.zip’ file on the site maybe…

For use git,
I created now repository on my Github,
cloned to desktop’s folder,
unzip ‘’ file to the folder,
did commit, publish
and, check the same result again.

What’s wrong with me?
I’m waiting your reply again
Thank you.

Ok I guess that may be not obvious for newcomers.

Follow the instructions on the wiki to setup Master (aka the lastest development). Try a build to unsure that everything is fine.

Then use git checkout copter-4.0.3 and git submodule update --init --recursive

The first git command use git to change master branch to copter-4.0.3 branch that you want. The second command will tell git to update the dependancies to the right version for copter-4.0.3

1 Like

Thank you very much khancyr.
I did as you said.
It was worked very well.
Thank you again.