Skip to content

Instantly share code, notes, and snippets.

@catskull
Created November 27, 2020 17:25
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 catskull/f4c15da32993fb14922a95336b5f1903 to your computer and use it in GitHub Desktop.
Save catskull/f4c15da32993fb14922a95336b5f1903 to your computer and use it in GitHub Desktop.
Flash an AVR/Arduino from a backup
#!/bin/bash
while [ true ] ; do
avrdude -V -p m32u4 -c usbtiny -U flash:w:backup_flash.bin
# avrdude -p m32u4 -c usbtiny -U eeprom:w:backup_eeprom.bin
avrdude -p m32u4 -c usbtiny -U hfuse:w:backup_hfuse.bin
avrdude -p m32u4 -c usbtiny -U lfuse:w:backup_lfuse.bin
avrdude -p m32u4 -c usbtiny -U efuse:w:backup_efuse.bin
say "flashing complete"
echo "Press any key to continue"
while [ true ] ; do
read -t 3 -n 1
if [ $? = 0 ] ; then
break
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment