You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Marius Greuel f6cc4f972d Update README.md 1 week ago
atmel-docs Just to make sure this won't get lost over time, make a copy of 6 years ago
doc Submitted by Reinhard Max 4 years ago
external Add support for Teensy bootloader 11 months ago
msvc Bump version to 6.3.1.1-windows 10 months ago
tools patch #9506: Script to create device configuration stub from Atmel ATDF files 4 years ago
windows Replace outdated FSF postal address by a reference to 9 years ago
.cvsignore So finally, also ignore the Makefile. 16 years ago
.editorconfig Add Travis CI support 2 years ago
.gitattributes Add support for Visual Studio 2019 2 years ago
.gitignore Add Travis CI support 2 years ago
.travis.yml Add Travis CI support 2 years ago
AUTHORS Fix author name in some files. 4 years ago
BUILD-FROM-SVN Submitted by Philip: 10 years ago
COPYING Replace outdated FSF postal address by a reference to 9 years ago
ChangeLog patch #8444: Proposal for modifications in -B and -U command options managment 4 years ago
ChangeLog-2001 Use my other e-mail. 19 years ago
ChangeLog-2002 Use my other e-mail. 19 years ago
ChangeLog-2003 * ChangeLog: Minor formatting cleanups. 18 years ago
ChangeLog-2004-2006 Fix author name in some files. 4 years ago
ChangeLog-2007 ChangeLog rotation for 2007->2008 transition. 14 years ago
ChangeLog-2008 Annual changelog rotation. 13 years ago
ChangeLog-2009 Annual changelog rotation. 12 years ago
ChangeLog-2010 Delete unneeded svn:executable property. 10 years ago
ChangeLog-2011 bug #21663 AT90PWM efuse incorrect 10 years ago
ChangeLog-2012 Annual ChangeLog rotation time. 9 years ago
ChangeLog-2013 Annual changelog rotation. 8 years ago
ChangeLog-2014 Annual ChangeLog rotation (quite late this year). 7 years ago
ChangeLog-2015 Annual changelog rotation. 6 years ago
ChangeLog-2016 Annual changelog rotation. 5 years ago
ChangeLog-2017 Annual ChangeLog rotation. 4 years ago
Makefile.am Add support for Teensy bootloader 11 months ago
NEWS patch #8444: Proposal for modifications in -B and -U command options managment 4 years ago
README Give some more installation/building hints. 8 years ago
README.md Update README.md 1 week ago
arduino.c added verbose level in avrdude_message() 8 years ago
arduino.h Replace outdated FSF postal address by a reference to 9 years ago
avr.c Submitted by Jan Egil Ruud <janegil.ruud@microchip.com> 4 years ago
avr910.c added verbose level in avrdude_message() 8 years ago
avr910.h Join the former "public" header files (avr.h avrpart.h pindefs.h 8 years ago
avrdude.1 Submitted by Reinhard Max 4 years ago
avrdude.conf.in Add support for Teensy bootloader 11 months ago
avrdude.h Add support for Visual Studio 2019 2 years ago
avrdude.sln Add Travis CI support 2 years ago
avrdude.spec.in Submitted by Galen Seitz: 16 years ago
avrdude.vcxproj Add support for Teensy bootloader 11 months ago
avrdude.vcxproj.filters Add support for Teensy bootloader 11 months ago
avrftdi.c Add support for FTDI devices via D2XX API 2 years ago
avrftdi.h bug #42662 clang warnings under FreeBSD 10.x 8 years ago
avrftdi_private.h Add support for FTDI devices via D2XX API 2 years ago
avrftdi_tpi.c Add support for FTDI devices via D2XX API 2 years ago
avrftdi_tpi.h Join the former "public" header files (avr.h avrpart.h pindefs.h 8 years ago
avrpart.c patch #8440 Print part id after signature 7 years ago
bitbang.c Fix author name in some files. 4 years ago
bitbang.h Fix author name in some files. 4 years ago
bootstrap bootstrap: Detect whether libtoolize is named `glibtoolize' (MacOS) 4 years ago
buspirate.c patch #8504 buspirate: Also support "cpufreq" extended parameter in binary mode 7 years ago
buspirate.h patch #7724 Add TPI support for Bus Pirate using bitbang mode 9 years ago
butterfly.c added verbose level in avrdude_message() 8 years ago
butterfly.h Replace outdated FSF postal address by a reference to 9 years ago
clean.bat Add support for FTDI devices via D2XX API 2 years ago
config.c Removing exit calls from config parser 8 years ago
config.h Removing exit calls from config parser 8 years ago
config_gram.y Submitted by Jan Egil Ruud <janegil.ruud@microchip.com> 4 years ago
configure.ac Fix a typo in previous commit. 4 years ago
confwin.c Join the former "public" header files (avr.h avrpart.h pindefs.h 8 years ago
crc16.c Major code cleanup. 15 years ago
crc16.h Major code cleanup. 15 years ago
dfu.c bug #42662 clang warnings under FreeBSD 10.x 8 years ago
dfu.h * flip2.c (flip2_page_erase): Remove unimplemented function. 8 years ago
fileio.c Change Intel HEX line length from 32 to 16 to match line length of avr-objcopy 4 years ago
flip1.c added verbose level in avrdude_message() 8 years ago
flip1.h Join the former "public" header files (avr.h avrpart.h pindefs.h 8 years ago
flip2.c Add support for Visual Studio 2019 2 years ago
flip2.h Join the former "public" header files (avr.h avrpart.h pindefs.h 8 years ago
freebsd_ppi.h Replace outdated FSF postal address by a reference to 9 years ago
ft245r.c Fix bug introduced in patch #8580 to allow usage with no -C option or -C ft[n] 2 years ago
ft245r.h Join the former "public" header files (avr.h avrpart.h pindefs.h 8 years ago
jtag3.c Submitted by Jan Egil Ruud: 4 years ago
jtag3.h Submitted by Jan Egil Ruud <janegil.ruud@microchip.com> 4 years ago
jtag3_private.h Submitted by Jan Egil Ruud <janegil.ruud@microchip.com> 4 years ago
jtagmkI.c bug #43137: Writing and reading incorrect pages when using jtagicemkI 7 years ago
jtagmkI.h Replace outdated FSF postal address by a reference to 9 years ago
jtagmkII.c Submitted by Tom Carney: 4 years ago
jtagmkII.h Replace outdated FSF postal address by a reference to 9 years ago
jtagmkII_private.h Fix byte-wise EEPROM and flash writes on Xmega 8 years ago
jtagmkI_private.h Replace outdated FSF postal address by a reference to 9 years ago
lexer.l Submitted by Jan Egil Ruud <janegil.ruud@microchip.com> 4 years ago
libavrdude.h Submitted by Jan Egil Ruud <janegil.ruud@microchip.com> 4 years ago
linux_ppdev.h * linux_ppdev.h: added missing msg level for avrdude_message in ppi_claim/ppi_release macros 8 years ago
linuxgpio.c bug #47550: Linux GPIO broken 6 years ago
linuxgpio.h patch #7165 Add support for bitbanging GPIO lines using the Linux sysf GPIO interface 9 years ago
lists.c Add support for Visual Studio 2019 2 years ago
main.c Allow %n in printf format string for MSVC 1 year ago
micronucleus.c Improve Micronucleus programmer error messages 11 months ago
micronucleus.h Add support for Micronucleus bootloader 3 years ago
my_ddk_hidsdi.h Replace outdated FSF postal address by a reference to 9 years ago
par.c added verbose level in avrdude_message() 8 years ago
par.h Replace outdated FSF postal address by a reference to 9 years ago
pgm.c Removing exit calls from config parser 8 years ago
pgm_type.c Add support for Teensy bootloader 11 months ago
pickit2.c Add support for Visual Studio 2019 2 years ago
pickit2.h Join the former "public" header files (avr.h avrpart.h pindefs.h 8 years ago
pindefs.c added verbose level in avrdude_message() 8 years ago
ppi.c added verbose level in avrdude_message() 8 years ago
ppi.h Replace outdated FSF postal address by a reference to 9 years ago
ppiwin.c Add support for Visual Studio 2019 2 years ago
safemode.c Reported by Roger A. Krupski: 5 years ago
ser_avrdoper.c Add support for Visual Studio 2019 2 years ago
ser_posix.c Submitted by Reinhard Max 4 years ago
ser_win32.c Add support for COM port discovery via USB VID/PID Add support for Leonardo USB bootloader auto-reset 2 years ago
serbb.h Fix author name in some files. 4 years ago
serbb_posix.c Fix author name in some files. 4 years ago
serbb_win32.c Add support for Visual Studio 2019 2 years ago
solaris_ecpp.h Replace outdated FSF postal address by a reference to 9 years ago
stk500.c Improve MSVC patch in stk500.c 2 years ago
stk500.h Replace outdated FSF postal address by a reference to 9 years ago
stk500_private.h Add support for displaying and changing the various STK500 operational 19 years ago
stk500generic.c added verbose level in avrdude_message() 8 years ago
stk500generic.h Replace outdated FSF postal address by a reference to 9 years ago
stk500v2.c Submitted by Axel Simon: 4 years ago
stk500v2.h * pgm_type.c: Add "jtagice3_isp" programmer hook 9 years ago
stk500v2_private.h Join the former "public" header files (avr.h avrpart.h pindefs.h 8 years ago
teensy.c Add support for Teensy bootloader 11 months ago
teensy.h Add support for Teensy bootloader 11 months ago
term.c added verbose level in avrdude_message() 8 years ago
term.h Join the former "public" header files (avr.h avrpart.h pindefs.h 8 years ago
tpi.h avr.c: Adds avr_tpi_program_enable 9 years ago
update.c patch #8444: Proposal for modifications in -B and -U command options managment 4 years ago
usb_hidapi.c Increase HID communication time-out for ATMEL ICE 2 years ago
usb_libusb.c patch #8435: Implementing mEDBG CMSIS-DAP protocol 6 years ago
usbasp.c Submitted by Maciej: 4 years ago
usbasp.h Join the former "public" header files (avr.h avrpart.h pindefs.h 8 years ago
usbdevs.h Add support for Teensy bootloader 11 months ago
usbtiny.c Correct endpoint direction for control messages of USBtinyISP devices 2 years ago
usbtiny.h Join the former "public" header files (avr.h avrpart.h pindefs.h 8 years ago
wiring.c added verbose level in avrdude_message() 8 years ago
wiring.h Replace outdated FSF postal address by a reference to 9 years ago

README.md

AVRDUDE for Windows

Build Status

This is a fork of AVRDUDE 6.3 from https://www.nongnu.org/avrdude/.

The purpose of this fork is to add better support for Windows to bring it on par with the Linux version of AVRDUDE.

Noteable changes include:

The original AVRDUDE project homepage can be found here https://savannah.nongnu.org/projects/avrdude.

Download

To get the latest version of AVRDUDE for Windows, go to the releases folder:

https://github.com/mariusgreuel/avrdude/releases

Feature Details

Support Atmel AVR programmers out of the box

This build contains support for Atmel AVR programmers, such as

This build does not rely on libusb drivers. Instead the default Atmel drivers can be used, allowing you to use AVRDUDE and Atmel Studio 7 side-by-side, without switching drivers.

If you previously changed the driver of your programmer to libusb, you should use Windows Device Manager to uninstall the device, and then reinstall using the default Windows drivers.

Support Micronucleus bootloader

This build adds support for the Micronucleus bootloader, so you do no longer need a separate command-line utility when working with devices that use the Micronucleus bootloader.

The Micronucleus bootloader is typically used on small ATtiny boards, such as Digispark (ATtiny85), Digispark Pro (ATtiny167), and the respective clones. By default, it uses the USB VID/PID 16D0:0753 (MCS Digistump).

Since this bootloader is optimized for size, it implements writing to flash memory only. As it does not support reading, you need to use the -V option to prevent AVRDUDE from verifing the flash memory. To have AVRDUDE wait for the device to be connected, use the extended option '-x wait'.

Example: Flashing a Micronucleus bootloader device

avrdude -c micronucleus -p t85 -x wait -V -U flash:w:main.hex:i

Support Teensy HalfKay bootloader

This build adds support for the Teensy HalfKay bootloader, so you do no longer need a the Teensy Loader tool when working with Teensy devices.

Since this bootloader is optimized for size, it implements writing to flash memory only. As it does not support reading, you need to use the -V option to prevent AVRDUDE from verifing the flash memory. To have AVRDUDE wait for the device to be connected, use the extended option '-x wait'.

Supported devices are:

  • Teensy 1.0 (AT90USB162)
  • Teensy 2.0 (ATmega32U4)
  • Teensy++ 1.0 (AT90USB646)
  • Teensy++ 2.0 (AT90USB1286)

Example: Flashing a Teensy 2.0 device

avrdude -c teensy -p m32u4 -x wait -V -U flash:w:main.hex:i

Support COM port discovery via USB VID/PID

Most Arduino boards use a USB-based virtual COM port, which is connected to some sort of bootloader. Since COM port numbers (COM1, COM2, ...) are determined by Windows, you first need to use Windows device manager to figure out the COM port before you can use AVRDUDE to flash the board. Alternatively, you may use Windows device manager to assign a COM port of your choice to the USB device. Additionally, the COM port of your Arduino board may change over time, for instance if you plug the device in a different USB port.

To simplify the discovery of your Arduino board, I provided the possibility to specify the USB vendor and product ID instead of the COM port.

For instance, to connect to an Arduino Leonardo, use the following command:

avrdude -c avr109 -P usb:2341:0036 -p m32u4

Since the USB vendor and device ID 2341:0036 is the identical for all Leonardo boards, the command above will work regardless of which COM port was actually assigned to your board.

Note that can cannot use this method if you have more than one device of the same type (i.e. that share the same USB VID/PID) plugged into your computer. Also, some devices ship various versions of firmwares using different VID/PID.

To figure out the USB VID and PID, you may use Windows devices manager (see the Hardware IDs of the Details tab of the USB device), or look it up in the official list of Arduino devices: https://github.com/arduino/ArduinoCore-avr/blob/master/boards.txt

USB VID/PID pairs for some popular boards and the respective commands are:

  • Arduino Uno Rev 3: 2A03:0043 -> avrdude -c arduino -P usb:2A03:0043 -p m328p
  • Arduino Micro: 2341:0037 -> avrdude -c avr109 -P usb:2341:0037 -p m32u4
  • Arduino Leonardo: 2341:0036 -> avrdude -c avr109 -P usb:2341:0036 -p m32u4
  • Sparkfun Pro Micro (5V): 1B4F:9205 -> avrdude -c avr109 -P usb:1B4F:9205 -p m32u4
  • Sparkfun Pro Micro (3.3V): 1B4F:9203 -> avrdude -c avr109 -P usb:1B4F:9203 -p m32u4
  • Adafruit Circuit Playground: 239A:0011 -> avrdude -c avr109 -P usb:239A:0011 -p m32u4

Support Arduino Leonardo bootloader auto-reset

Before any Arduino board may be flashed via the bootloader, you need to kick it into bootloader mode first. This can done manually by pressing the reset button, or automatically via an special auto-reset mechanism: For boards with a USB to serial converter chip (such as Arduino Uno or Nano), the tool needs to pull the DTR signal to low, which will briefly pull the RESET pin of the microcontroller to low. For boards with a direct USB connection (such as Arduino Leonardo or Micro), the sketch typically implements a serial port via a USB composite device with a virtual COM port. To perform the auto-reset, the sketch implements a hack that resets the device into bootloader mode when the COM port is opened with a baudrate of 1200bps. To make matters even more complicated, the bootloader COM port has a different USB VID:PID pair than the sketch COM port, which causes the COM port to change while performing the reset.

To simplify the process of auto-resetting the board, this version will auto-reset the device when AVRDUDE detects that the device is running in sketch mode. Note that the sketch is required to implement a USB composite device with a virtual COM port with a matching USB VID:PID, which is implemented in the Arduino core software.

Support WinUSB devices via custom libusb

Since AVRDUDE originated from Unix, the USB support in AVRDUDE is built upon the Unix-based USB library libusb. In order to support Windows, libusb has been ported to Windows libusb-win32.

The downside of using libusb-win32 is that it requires the user to manually install a kernel-mode driver (libusb0.sys or libusbk.sys) instead of the manufacturer supplied Windows driver. There are several hacks to accomplish this, such as the Zadig driver installation utility, which installs a self-signed root certificate in the Windows driver store due to the lack of proper driver installation packages.

This build contains a custom library called libwinusb, which implements a sub-set of the libusb-win32 API. The libwinusb implementation supports both the winusb.sys driver, and the libusb0.sys driver as well. This patch has a number of advantages, such as

  • Many USB devices that ship with WinUSB drivers, such as Atmel programmer, will run out of the box.
  • Works with both WinUSB and libusb: You can use either Windows built-in WinUSB driver to access your USB devices, or keep using the libusb drivers if you have them installed already.
  • No static dependency to libusb0.dll: You cannot run the original version AVRDUDE, unless you previously installed libusb. On systems where libusb is not installed, this build eliminates the error "The code execution cannot proceed because libusb0.dll was not found. Reinstalling the program may fix this problem".

Microsoft OS descriptors and firmware examples

Windows provides a mechanism to automatically load the built-in WinUSB driver without providing a driver installation package (INF file). The automatic WinUSB driver installation is triggered via a special Microsoft OS descriptor that must be present in the firmware of the USB device.

To demonstrate how this works, I added Microsoft OS descriptors to the following projects:

Support FTDI devices via custom libftdi

In order to support FTDI devices, AVRDUDE uses the Unix-based library libftdi1. Similar to libusb, the libftdi1 library does not play nice on Windows: On Windows, FTDI devices load the manufacturer supplied driver via plug-and-play. The FTDI drivers implement an API via the FTDI D2XX DLLs. However, libftdi1 cannot use the D2XX interface, so it will not work with the plug-and-play drivers.

This build contains a patches library of libftdi. The patches load the D2XX DLLs to support FTDI devices, so FTDI devices will just work.

Support HID devices via libhidapi

This build include the WIN32 version of libhidapi, and some patches, to allow HID devices to work out of the box.

Support Visual Studio

This build adds support for Microsoft Visual Studio. Building AVRDUDE with Microsoft Visual C/C++ will give you the best user and debugging experience while working on Windows.

Miscellaneous bug-fixes and patches

Releases

You can find the latest releases of AVRDUDE for Windows here:

https://github.com/mariusgreuel/avrdude/releases

Users manual

You can find the original users manual (does not contain AVRDUDE for Windows extras) of AVRDUDE here:

https://www.nongnu.org/avrdude/user-manual/avrdude.html

Build

Building AVRDUDE for Windows

Windows Prerequisites

In order to build AVRDUDE on Windows, you need:

  • Microsoft Visual Studio 2019 with 'Desktop development with C++' enabled

Windows Build Instructions

To build AVRDUDE on Windows, do the following:

  • git clone --branch windows https://github.com/mariusgreuel/avrdude
  • Open the solution avrdude.sln and build the project.

Note: The folder msvc\generated includes pre-built files from the AVRDUDE configure and grammar generation.

Building AVRDUDE for Linux

Note that the AVRDUDE for Linux version does not contain all extra Windows features. The features that have been added to the stock version of AVRDUDE include:

  • Support Micronucleus bootloader
  • Support Teensy HalfKay bootloader

Linux Prerequisites

In order to build AVRDUDE on Linux, you need to install the following packages:

sudo apt install git make gcc automake libtool flex bison libelf-dev libusb-dev libftdi1-dev libhidapi-dev

Linux Build Instructions

To build AVRDUDE on Linux, run the following commands:

git clone --branch windows https://github.com/mariusgreuel/avrdude
cd avrdude
./bootstrap
./configure
make

To install a local build of AVRDUDE on your system, run the following command:

sudo make install

Linux udev rules

If you intent to use either the Micronucleus or Teensy bootloader, you should edit the udev rules so that you can run AVRDUDE without root.

For instance, if you are on Ubuntu and you installed the avrdude package, you would edit /lib/udev/rules.d/60-avrdude.rules and add the following rules:

# Micronucleus Bootloader
SUBSYSTEM=="usb", ATTR{idVendor}=="16d0", ATTR{idProduct}=="0753", TAG+="uaccess"
# Teensy Bootloader
SUBSYSTEM=="usb", ATTR{idVendor}=="16c0", ATTR{idProduct}=="0478", TAG+="uaccess"

Troubleshooting Tips & Tricks

Atmel DFU Device driver broken

The current version of the Atmel DFU drivers that are distributed via the Windows Update are goofed up (@Atmel: It might have something to do with the fact that you commented out the CopyFiles sections!). Symptoms are:

  • You cannot use AVRDUDE to connect to an Atmel DFU device, and you get the error message "No matching USB device found".
  • When installing the drivers via Windows Update, you get the error message "Windows encountered a problem installing the drivers for your device" and "A service installation section in this INF is invalid."
  • In Windows Device Manager, the Atmel DFU device shows up as an unknown device.

You should use an older driver package that does not contain this bug.

Outdated libusb0 driver

The most current version of libusb0.sys is 1.2.6.0, signed on 12/17/2012 by Travis Lee Robinson. If you are using an older version (check with Windows Device Manager), you may not be able to connect to your USB devices using the libusb0 driver.

License

AVRDUDE is licensed under the GNU GPLv2.