Skip to content

Instantly share code, notes, and snippets.

@prasertsakd
Last active March 3, 2017 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prasertsakd/a4f05aa46e7d751590c698fa6ad5c279 to your computer and use it in GitHub Desktop.
Save prasertsakd/a4f05aa46e7d751590c698fa6ad5c279 to your computer and use it in GitHub Desktop.
for reflash mega16u2 to usbserial use avrdude
@echo off
set arduino_path=c:\arduino-1.6.12
set firmware=Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex
set avrdude.exe=%arduino_path%\hardware\tools\avr\bin\avrdude.exe
set avrdude.conf=%arduino_path%\hardware\tools\avr\etc\avrdude.conf
%avrdude_path% -c usbtiny -p m16u2 -C %avrdude_conf% -F -D -U flash:w:%firmware% -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment