Go Down

Topic: Uno to Uno bootloader (Read 896 times) previous topic - next topic

ov10fac

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.

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



DrAzzy

You do, however, need at least one working Arduino, if that wasn't clear.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

ov10fac

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.

pert

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.

ov10fac

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.
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.

pert

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

ov10fac

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.

ov10fac

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.

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.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

pert

Quote
Incorrect programmer -carduino in the command. It should be -cstk500v2.
It was changed to -carduino in Arduino AVR Boards 1.6.22:
https://github.com/arduino/Arduino/pull/3687
Still open for some reason, but cherry-picked into Arduino AVR Boards here:
https://github.com/arduino/ArduinoCore-avr/commit/b084848f2eaf9ccb3ac9a64ac5492d91df4706bf

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.

Budvar10

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".
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Coding Badly

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.


pert

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.

ov10fac

#14
Nov 06, 2018, 12:12 am Last Edit: Nov 06, 2018, 01:21 am by ov10fac
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.

Go Up