Compiling avrdude with MinGW/MSYS
It looks like Cygwin is not a recommended build environment for arvdude (see bug #29263) anymore, so in order to build avrdude for Windows you should use MinGW/MSYS. Surprisingly this is quite simple:
- download MinGW (I've used automated installer mingw-get-inst-20110316.exe),
- install MinGW, required components are C Compiler and MSYS Basic System (109 MB total), preferably to default directory (no spaces in name),
- download binary release of libusb-win32 (in my case libusb-win32-bin-184.108.40.206.zip),
- copy from libusb package:
include\usb.h -> C:\MinGW\include\ lib\gcc\libusb.a -> C:\MinGW\lib\ bin\x86\libusb0_x86.dll (or other depending on your OS) -> C:\MinGW\bin\
- start MinGW shell (shortcut created at Programs menu or
C:\MinGW\msys\1.0\msys.bat), it will create home directory
- extract avrdude sources (
avrdude-5.10.tar.gzin my case) to your
- type (and hit enter):
avrdude.exeshould be created in the avrdude sources directory, with libusb support it has 847 kB in my case,
- optionally reduce avrdude binary size by stripping debug symbols, type:
- for testing connect programmer and target board
(usbasp + ATmega8 board in my case, command will be different for other programmer/MCU)
and to read device signature type:
avrdude -c usbasp -p m8
Resulting binary: avrdude.zip.
Note: downloading and installing libusb is optional, if you are going to use only i.e. STK-200 programmer you can skip it. It is required to use avrdude with usbasp.
Changes for avrdude 5.11 and MinGW/MSYS 20110802
- it looks like bison/yacc was not installed when choosing "MSYS Basic System" in MinGW installer; install MinGW with "MinGW Developer Toolkit" component option checked,
- it seems that avrdude 5.11 is not yet compatible with libusb-win32 1.2.5 (although this is only header name mismatch usb.h (expected) and lusb0_usb.h (libusb 1.2.5) most likely); use libusb-win32 1.2.4 or older.
Resulting binary: avrdude-5.11-w32-libusb.zip (no libftdi).
You can find build with libftdi at AVR Freaks Forum, savannah.gnu.org.
With avrdude 6.0.1 (Sep 2013) and 6.1 (Mar 2014) official avrdude Windows binaries are provided by the author.