Flashing Boot Loader
From: https://www.instructables.com/Flashing-bootloader-into-Arduino-UNO-R3/
Flashing Bootloader Into Arduino UNO R3
By nicoo in CircuitsArduino
nicooBy nicoo
More by the author:
Vintage Tech: Le Minitel
Hacked roomba + arduino snowballs into a Eurobot 2013 entry...
Arduino Sprinkler System + Web control
Flashing Bootloader Into Arduino UNO R3
I bricked my arduino... again. And now I am out of pre-programmed chips.
Time to flash bootloaders myself...
Luckily I have a USBtinyISP (v2.0). I had never used it though and I managed
to struggle to load a bootloader into my arduino. So, for your (my)
reference, here are the steps that allowed me to flash a batch of ATMega328
(and ATMega328p).
For this instructable you will need:
- 1 x arduino board
- 1 x USBtinyISP (pay about 10$ for it on ebay)
References:
https://learn.adafruit.com/usbtinyisp
Step 1: Command Line Options for Avrdude
Command Line Options for Avrdude
I performed said steps on a Windows box (running XP), so it is possible to
do this on a PC ! The command lines should / must be exactly the same on a
Linux box or an OSX box.
The arduino IDE installed on my box is arduino-1.0.1
In a terminal (a DOS prompt), cd into the directory arduino-1.0.1, then
run:
hardware/tools/avr/bin/avrdude.exe -C hardware/tools/avr/etc/avrdude.conf
-b19200 -c usbtiny -p m328p -v -e -U flash:w:hardwar
e/arduino/bootloaders/optiboot/optiboot_atmega328.hex -U lock:w:0x0F:m -F
where:
avrdude.conf: configuration file
usbtiny: type of programmer (USBtiny)
m328p: type of chip to program (ATMega328p)
optiboot_atmega328.hex: magic file (bootloader) for Arduino UNO R3
-F: force (for ATMega328 chips which are the same as ATMega328p for flashing
purposes but are different enough so that they don't have the same signature
as ATMega328p chips)
Attached is the avrdude output (avrdude.txt), enjoy...
Voila !
Attachments
download {{ file.name }}avrdude.txt
avr dude
avrdude.exe: Version 5.11, compiled on Sep 2 2011 at 19:38:36
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "hard
ware/tools/avr/etc/avrdude.conf"
Using Port : lpt1
Using Programmer : usbtiny
Overriding Baud Rate : 19200
avrdude: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\\.\libusb0-0001
--0x1781-0x0c9f
AVR Part : ATMEGA328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page
Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages
MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ -
---- ----- ---------
eeprom 65 20 4 0 no 1024 4 0
3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256
4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0
4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0
4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0
4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0
4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0
0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0
0 0 0x00 0x00
Programmer Type : USBtiny
Description : USBtiny simple USB programmer,
http://www.ladyada.net/make/usbtinyisp/
avrdude.exe: programmer operation not supported
avrdude.exe: Using SCK period of 10 usec
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude.exe: Device signature = 0x1e950f
avrdude.exe: safemode: lfuse reads as FF
avrdude.exe: safemode: hfuse reads as DA
avrdude.exe: safemode: efuse reads as 5
avrdude.exe: erasing chip
avrdude.exe: Using SCK period of 10 usec
avrdude.exe: reading input file "hardware/arduino/bo
otloaders/optiboot/optiboot_atmega328.hex"
avrdude.exe: input file hardware/arduino/bootloaders
/optiboot/optiboot_atmega328.hex auto detected as Intel Hex
avrdude.exe: writing flash (32768 bytes):
Writing | ################################################## | 100% 19.58s
avrdude.exe: 32768 bytes of flash written
avrdude.exe: verifying flash memory against hardware
/arduino/bootloaders/optiboot/optiboot_atmega328.hex:
avrdude.exe: load data flash data from input file ha
rdware/arduino/bootloaders/optiboot/optiboot_atmega328.hex:
avrdude.exe: input file hardware/arduino/bootloaders
/optiboot/optiboot_atmega328.hex auto detected as Intel Hex
avrdude.exe: input file hardware/arduino/bootloaders
/optiboot/optiboot_atmega328.hex contains 32768 bytes
avrdude.exe: reading on-chip flash data:
Reading | ################################################## | 100% 17.54s
avrdude.exe: verifying ...
avrdude.exe: 32768 bytes of flash verified
avrdude.exe: reading input file "0x0F"
avrdude.exe: writing lock (1 bytes):
Writing | ################################################## | 100% 0.02s
avrdude.exe: 1 bytes of lock written
avrdude.exe: verifying lock memory against 0x0F:
avrdude.exe: load data lock data from input file 0x0F:
avrdude.exe: input file 0x0F contains 1 bytes
avrdude.exe: reading on-chip lock data:
Reading | ################################################## | 100% 0.00s
avrdude.exe: verifying ...
avrdude.exe: 1 bytes of lock verified
avrdude.exe: safemode: lfuse reads as FF
avrdude.exe: safemode: hfuse reads as DA
avrdude.exe: safemode: efuse reads as 5
avrdude.exe: safemode: Fuses OK
avrdude.exe done. Thank you.