Skip to content

Instantly share code, notes, and snippets.

@bapril
Last active October 21, 2016 17:55
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 bapril/9efaa1e79b91e01170f3635f9600f718 to your computer and use it in GitHub Desktop.
Save bapril/9efaa1e79b91e01170f3635f9600f718 to your computer and use it in GitHub Desktop.
#Pair of command-sets to resurrect an Arduino Uno
#Get the hex image.
cd /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin
./avrdude -p m16u2 -C ../etc/avrdude.conf -c usbtiny -V
./avrdude -p m16u2 -C ../etc/avrdude.conf -c usbtiny -U erase
./avrdude -p m16u2 -C ../etc/avrdude.conf -P usb -c usbtiny -U flash:w:../../../arduino/avr/firmwares/atmegaxxu2/UNO-dfu_and_usbserial_combined.hex
./avrdude -p m16u2 -C ../etc/avrdude.conf -P usb -c usbtiny -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m
./avrdude -p m328p -C ../etc/avrdude.conf -c usbtiny -V
# Expect:
#avrdude: Device signature = 0x1e950f
#
#avrdude: safemode: Fuses OK (H:05, E:DE, L:FF)
./avrdude -p m328p -C ../etc/avrdude.conf -c usbtiny -U erase
./avrdude -p m328p -C ../etc/avrdude.conf -P usb -c usbtiny -e -U flash:w:../../../arduino/avr/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex
./avrdude -p m328p -C ../etc/avrdude.conf -c usbtiny -U lfuse:w:0xFF:m -U hfuse:w:0xDE:m -U efuse:w:0x05:m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment