How to program the Arduino Bootloader using an ISP to a vanilla ATMEGA
-
if you have just a vanilla ATmega Microcontroller or you wrote something over the bootloader you may want to reload the bootloader onto the device, so that the device can be programmed (again) via the USB-serial line inteface.
Where to find the bootloader HEX file when the ARDUINO IDE is installed?
Under the directory where the ARDUINO-IDE is installed [x] go to
$ cd [x]/arduino-1.8.0/hardware/arduino/avr/bootloaders/atmega
How to download the bootloader onto the Device
for an ATmega328p Device using the AVR-ISP on a linux mashine
$ sudo avrdude -pm328p -cavr911 -P/dev/ttyUSB0 -Uflash:w:ATmegaBOOT_168_atmega328.hex:a -Ulfuse:w:0xff:m -Uhfuse:w:0xde:m -Uefuse:w:0x5:m -Ulock:w:0xf:m