Uno to Uno bootloader

Is it possible to upload the bootloader from one UNO to another? It seems to be possible on to upload from UNO to other boards, but I can't seem to find any posts on UNO to UNO. If I can't upload the bootloader, can I upload a program from one UNO to another like is possible with the UNO to Nano?

The reason I ask is I have two UNO (Chinese clones) that are not accepting uploads. I have done all the trouble shooting and I suspect a bootloader issue with both of them. I figure if I can re-initialize the bootloader that will at least eliminate one possible issue.

Thanks.

Yes, you can use an Uno as an "Arduino as ISP" to burn the bootloader to an Uno.

You can use it to burn the bootloader to any AVR microcontroller-based Arduino board. In fact, I'm quite surprised that you didn't find the official Arduino as ISP tutorial that shows just this:

You do, however, need at least one working Arduino, if that wasn't clear.

pert:
Yes, you can use an Uno as an "Arduino as ISP" to burn the bootloader to an Uno.

You can use it to burn the bootloader to any AVR microcontroller-based Arduino board. In fact, I'm quite surprised that you didn't find the official Arduino as ISP tutorial that shows just this:
https://www.arduino.cc/en/Tutorial/ArduinoISP

Thank you. I was pretty sure is would work. I too am surprised I didn't find it, but I have it now, so thanks.

ov10fac:
The reason I ask is I have two UNO (Chinese clones) that are not accepting uploads. I have done all the trouble shooting and I suspect a bootloader issue with both of them. I figure if I can re-initialize the bootloader that will at least eliminate one possible issue.

Per your other thread:
http://forum.arduino.cc/index.php?topic=577751
Burning the bootloader has no chance of fixing the issue of the CH340 not being recognized. Burn Bootloader can only help when the computer gets a virtual COM port for the board but can't upload to it.

pert:
Per your other thread:
Cannot detect UNO USB port - IDE 1.x - Arduino Forum
Burning the bootloader has no chance of fixing the issue of the CH340 not being recognized. Burn Bootloader can only help when the computer gets a virtual COM port for the board but can't upload to it.

Thank you. Yes, that's a different problem. I have two UNOs with this problem and three with the USB issue. Seperate threads for seperate issues.

Oh wow, that's rough. Well I hope you can resurrect some of them!

pert:
Oh wow, that's rough. Well I hope you can resurrect some of them!

Me too. I have project plans for all of them if I can get them running.

Ok,
Followed the guidance in the tutorial. Made all the connections and everything. Uploaded the ArduinoISP to the Programmer UNO and started the "Burn Bootloader". Then it failed with the following error messages:

Arduino: 1.8.7 (Linux), Board: "Arduino/Genuino Uno"

/home/jwright/Public/arduino-1.8.7/hardware/tools/avr/bin/avrdude -C/home/jwright/Public/arduino-1.8.7/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyACM0 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/home/jwright/Public/arduino-1.8.7/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/home/jwright/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/ttyACM0
Using Programmer : arduino
Overriding Baud Rate : 19200
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 : Arduino
Description : Arduino

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x02

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
Hardware Version: 4238814
Firmware Version: 28284272.0
Topcard : STK502
Vtarget : 1.8 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x10

avrdude done. Thank you.

Error while burning bootloader.

Unfortunately I have no idea what the error messages might be trying to tell me.

Incorrect programmer -carduino in the command. It should be -cstk500v2. What did you select?
Or, try to connect capacitor with big value ~1uF between RESET and GND and run it again as is.

Incorrect programmer -carduino in the command. It should be -cstk500v2.

It was changed to -carduino in Arduino AVR Boards 1.6.22:

Still open for some reason, but cherry-picked into Arduino AVR Boards here:

The reason for the change is to allow ATmega32U4-based boards to be able to be used for Arduino as ISP. The downside is this makes it more likely that a capacitor is required. I'm not sure this was a good change. Years ago, I created a 3rd party "ATmega32U4 as ISP" programmer package to deal with this issue and I think that was a quite reasonable solution.

Hmm, interesting. However, there is stk500v1 in v1.8.5. I don't know how about v1.8.7 (OPs ver.) but I see in the latest version on Git "arduino".

ov10fac:
Is it possible to upload the bootloader from one UNO to another?

Yes. And Nick Gammon has published a sketch that makes the process a bit easier.

Arduino AVR Boards 1.6.20 is bundled with Arduino IDE 1.8.5.
Arduino AVR Boards 1.6.22 is bundled with Arduino IDE 1.8.6.
Arduino AVR Boards 1.6.23 is bundled with Arduino IDE 1.8.6.

But ever since the introduction of Boards Manager, it doesn't make sense to associate Arduino AVR Boards versions with a specific Arduino IDE version. You could have any Arduino AVR Boards version installed with any Arduino IDE version.

I would say it's just as likely that someone using Arduino IDE 1.8.5 would have Arduino AVR Boards 1.6.23 installed, since by default the IDE nags you to update when there is a newer version available.

Arduino AVR Boards 1.6.22 and newer uses an AVR-GCC version that has some serious problems and the solution is to roll back to the last good version. So quite a few people running Arduino IDE 1.8.7 will be using Arduino AVR Boards 1.6.21.

Then there was the issue of the Nano bootloader change in Arduino AVR Boards 1.6.21. Even though the solution was simply to select the correct thing in the Tools > Processor menu, that was too difficult for some people and so instead they chose the (much more difficult) solution of rolling back to Arduino AVR Boards 1.6.20.

Budvar10:
Incorrect programmer -carduino in the command. It should be -cstk500v2. What did you select?
Or, try to connect capacitor with big value ~1uF between RESET and GND and run it again as is.

Saw that. I selected Arduino UNO as that was the board I used as programmer and target. I saw the capacitor refernece in several posts on this error and in the instructions, but it was not for the UNO, but the Arduino Mega. I can do that and try again.

I inserted the cap, and still get the errors

Is it possible that the USB port is too slow? A lot of things I have read seem to indicate a timing issue may be the problem. Just throwing things out.

Parameter -carduino produce reset pulse which resets programmer board, while the -cstk500v1 is without reset. Reset pulse for programmer board is undesirable in this operation. Large capacitor cca 10uF on reset pin allow to "fly over" the pulse. Same for Mega.
USB port is not slow. Uploading speed is just 19200 baud (-b19200 parameter). It is hard coded speed in ISP sketch.
Maybe there is another problem with your setup.

ok,
Thought about it overnight and this morning. Re-wired everything, and re-read the instructions. This morning I get the following error message:

Arduino: 1.8.7 (Linux), Board: "Arduino/Genuino Uno"

/home/jwright/Public/arduino-1.8.7/hardware/tools/avr/bin/avrdude -C/home/jwright/Public/arduino-1.8.7/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyACM0 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/home/jwright/Public/arduino-1.8.7/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/home/jwright/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/ttyACM0
Using Programmer : arduino
Overriding Baud Rate : 19200
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 : Arduino
Description : Arduino
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Error while burning bootloader.
Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0xffffff (probably .avr8x_mega)
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

So I copied the command and ran it on my computer with the -F. The code completed and everything looked great. I tried to upload the Blink sketch, and the same problem. Both boards reacted the same way, so my thinking is the boards are shot.

Any other ideas?

ov10fac:
So I copied the command and ran it on my computer with the -F.

Don't do that. It makes the situation worse.

The code completed and everything looked great.

Precisely. "Looked great" because the errors were ignored.

ov10fac:
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s

Is usually a wiring problem. Carefully recheck the wiring. If you have a meter check continuity. Or use an LED + resistor to check continuity.

When you power the target, does the LED on pin 13 blink?

Ok,
I will set things back up later today. I moved on to another project while I was thinking about my next step, which you just gave me. I will connect everything back up and see what happens. The resistor/led is a good idea. I have a few 2.2V LEDs around that should work just fine.