Nano: Switch from Optiboot to factory boot loader failed

Hello,

Im trying to switch my Chinese Nano Model back to the factory bootloader.
When writing the "Nano" boot loader back an error came up and since then I can't make any boot loader writing or sketch/code upload working correctly.

When trying to burn the boot loader via Arduino as ISP, this message comes up:

Arduino: 1.8.9 (Mac OS X), Board: "Arduino/Genuino Uno"

/Users/seniorrossi/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/bin/avrdude -C/Users/seniorrossi/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/cu.wchusbserial1420 -b115200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m 

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:01:35
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/seniorrossi/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf"
         User configuration file is "/Users/seniorrossi/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.wchusbserial1420
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
         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 : STK500
         Description     : Atmel STK500 Version 1.x firmware
         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.07s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.07s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.07s

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


avrdude done.  Thank you.

Fehler beim Brennen des Bootloaders.

When trying to regularly upload a sketch via AVRISP mkll, this message comes up:

Arduino: 1.8.9 (Mac OS X), Board: "Arduino/Genuino Uno"

Warning: Board Optiboot:avr:OptiBootatmega328 doesn't define a 'build.board' preference. Auto-set to: AVR_OPTIBOOTATMEGA328
Der Sketch verwendet 4380 Bytes (13%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 481 Bytes (23%) des dynamischen Speichers, 1567 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
/Users/seniorrossi/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/bin/avrdude -C/Users/seniorrossi/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf -v -patmega328p -carduino -P/dev/cu.wchusbserial1420 -b115200 -D -Uflash:w:/var/folders/qw/srdjhmq178nbv_t712c2w6kr0000gp/T/arduino_build_714041/ArduinoISP_ok.ino.hex:i 

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:01:35
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/seniorrossi/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf"
         User configuration file is "/Users/seniorrossi/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.wchusbserial1420
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done.  Thank you.

Problem beim Hochladen auf das Board. Hilfestellung dazu unter http://www.arduino.cc/en/Guide/Troubleshooting#upload.

Dieser Bericht wäre detaillierter, wenn die Option
"Ausführliche Ausgabe während der Kompilierung"
in Datei -> Voreinstellungen aktiviert wäre.

Thanks a very lot for your help in advance
Andrew

what is what you call factory bootloader?

why do you have Uno selected in Tools menu?

do you have a AVRISP mkll programmer?

Juraj:
what is what you call factory bootloader?

The Bootloader from the board in the menu "Amtel atmega328p Xplained mini" which was provided together with the Arduino compatible Nano Im using. Its compatible with the Nano "old bootloader".

why do you have Uno selected in Tools menu?

Because it was the bootloader I went to when switching to Optiboot a time ago. But no matter if now choosing Nano, Uno or whatever from the tools menu, I get the same problems with
"avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: ...."

do you have a AVRISP mkll programmer?

No thats the Programmer I always used when directly uploading sketches to my Arduino without any problems.

Attached you can find my "Boards.txt" and "Programmers.txt", ... and sorry I forgot to say, Im on Mac, but this issue above should be platform independent I guess.

And ... I use as programmer a simple second Arduino, no third party product.
Worked without problems when writing the "Uno" Bootloader (means optiboot/optiboot_atmega328.hex file) before

boards_Programmers.zip (6.91 KB)

AndrewCologne:
Warning: Board Optiboot:avr:OptiBootatmega328 doesn't define a 'build.board' preference. Auto-set to: AVR_OPTIBOOTATMEGA328

From this message, it looks to me like you used either some customized hardware package of your own devising, or an obscure 3rd party package to install Optiboot on your Nano (I guess you didn't know you could have just used the Arduino/Genuino Uno board definition). Were you ever able to use your Nano with the Optiboot bootloader installed?

AndrewCologne:
No thats the Programmer I always used when directly uploading sketches to my Arduino without any problems.

When you click the Upload button or do a Sketch > Upload, the Tools > Programmer menu selection is completely ignored. So it makes no different what you have selected from that menu when you do that and mentioning the programmer selection is only going to confuse people into thinking you're trying to do a Sketch > Upload Using Programmer. The Tools > Programmer menu selection only matters when you are doing Tools > Burn Bootloader or Sketch > Upload Using Programmer.

pert:
From this message, it looks to me like you used either some customized hardware package of your own devising, or an obscure 3rd party package to install Optiboot on your Nano (I guess you didn't know you could have just used the Arduino/Genuino Uno board definition). Were you ever able to use your Nano with the Optiboot bootloader installed?

Yes, I exactly used the Arduino/Genuino Uno board definition for burning the bootloader to my Nano. Then I was able to benefit from the faster startup speed compared to the 3 seconds initializing with the Nano standard factor bootloader. I only had to change the baud rate in "programmers.txt" and the "ArduinoSIP.ino" sketch to 115200 to make it recognizing and burning the bootloader to my Nano

When you click the Upload button or do a Sketch > Upload, the Tools > Programmer menu selection is completely ignored. So it makes no different what you have selected from that menu when you do that and mentioning the programmer selection is only going to confuse people into thinking you're trying to do a Sketch > Upload Using Programmer. The Tools > Programmer menu selection only matters when you are doing Tools > Burn Bootloader or Sketch > Upload Using Programmer.

Ah ok, ... thanks for clarifying!

new original classic Nanos have Optiboot.
to burn the old Nano bootloader, setup Arduino as ISP then select Nano and 328p (Old bootloader) in Tools menu.
and add a 10uF capacitor between reset and 5V on programmer board to suppress the auto-reset, which causes your sync problems

Thanks for the hint! Ill try when Im at home.

Does a 100uF capacitor does also the job? Cause 10uF I do not have now.

I thought only Unos need that capacitor:
http://arduino.cc/en/Tutorial/ArduinoISP

new original classic Nanos have Optiboot.

Ah, so Optiboot is the officially bootloader installed when buying original Unos and Nanos from Arduino?

the capacitor is for the programmer board, not for programmed board and the tutorial has it for Mega, but now it is always required.

Thanks Juraj

I'll let you know if it works.

Doesn't work. No matter if Nano, Uno or whatever board selected from the board menu.
Also tried dif.. Baud rates in the ArduinoISP sketch and the programmers.txt file, 19200, 57600, 115200 ...

100nf Capacitor is connected on the programmers board (long wire to reset (D10) and short to GND).

Output is:

Arduino: 1.8.9 (Mac OS X), Board: "Arduino Nano, ATmega328"

/Users/seniorrossi/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/bin/avrdude -C/Users/seniorrossi/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/cu.wchusbserial1420 -b115200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m 

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:01:35
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/seniorrossi/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf"
         User configuration file is "/Users/seniorrossi/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.wchusbserial1420
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
         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 : STK500
         Description     : Atmel STK500 Version 1.x firmware
         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.07s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.07s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.07s

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


avrdude done.  Thank you.

Fehler beim Brennen des Bootloaders.

Dieser Bericht wäre detaillierter, wenn die Option
"Ausführliche Ausgabe während der Kompilierung"
in Datei -> Voreinstellungen aktiviert wäre.

I did a try with another traget Nano from the same manufacturer.
I did change the Boards Version to 1.6.20 and ... after changing the baud rate in the "Arduino as ISP" programmer.txt to 115200 ->it worked with this other target Nano one, even with no capacitor applied to the programmer nano device.

Switched the target board back to the Nano one from before which brought me into the problems mentioned above and .... still doesn't work. maybe I screwed the board with all boot loading attempts up?!

The wiring can't be the guilty as it works flawlessly with the other Nano ....

Im lost. :frowning:

5V to reset with a cap. you want to hold the reset pin pulled-up.

everything works as configured in IDE at default

Hi Juraj,

even with capacitor set between 5v and GND ... still doesn't work with this Nano.

Arduino: 1.8.9 (Mac OS X), Board: "Arduino/Genuino Uno"

/Users/seniorrossi/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/bin/avrdude -C/Users/seniorrossi/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/cu.wchusbserial1420 -b115200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m 

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:01:35
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Users/seniorrossi/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf"
         User configuration file is "/Users/seniorrossi/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.wchusbserial1420
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
         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 : STK500
         Description     : Atmel STK500 Version 1.x firmware
         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.07s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.07s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.07s

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


avrdude done.  Thank you.

Fehler beim Brennen des Bootloaders.

Dieser Bericht wäre detaillierter, wenn die Option
"Ausführliche Ausgabe während der Kompilierung"
in Datei -> Voreinstellungen aktiviert wäre.

The auto-reset disable capacitor is wired between the reset and the ground pin:

pert:
The auto-reset disable capacitor is wired between the reset and the ground pin:

sorry

pert:
The auto-reset disable capacitor is wired between the reset and the ground pin:
https://www.arduino.cc/en/Tutorial/ArduinoISP

Yes, thats how I did it first.

But as mentioned above, doesn't work in case of the Nano where I try to write the boot loader without success.
The other Nano works fine (both with 115200 set as baud rate in the Arduino as ISP programmers.txt).

As the problematic Nano can't be used to burn the boot loader or a sketch via programmer, neither uploading a sketch the normal way, I guess I bricked the Nano at my first attempt to re overwrite the burned Optiboot boot loader with old boot loader back to its factory state.

The auto-reset disable capacitor is often not necessary when you're using the old Arduino as ISP programmer definition that uses the stk500v1 protocol. From the Burn Bootloader output you posted in your first post, I can see that the stk500v1 protocol is being used. The arduino protocol used by the Arduino as ISP programmer definition in the latest versions of Arduino AVR Boards makes it much more likely that the auto reset capacitor will be needed.

AndrewCologne:
As the problematic Nano can't be used to burn the boot loader or a sketch via programmer, neither uploading a sketch the normal way, I guess I bricked the Nano at my first attempt to re overwrite the burned Optiboot boot loader with old boot loader back to its factory state.

it is not possible to brick an ATmega this way.

Got three new Arduino compatible Nanos from the same seller yesterday.
Burning bootloader, sketch upload via Programmer and the regular sketch uploads did work flawlessly.

The one Nano we where talking about yesterday is somewhere flawed – don't know where and why, but 3 Euros are not worth it trying more than two days to reactivate him. Maybe accept its RIP is the most efficient and still empathic choice :slight_smile: