32U4 board - The IDE seems unable to reset chip for programming

For some reason I am suddenly unable to program the chip.
All connections have been verified and the serial port works fine with the sketch already programmed.
The IDE seems unable to reset the chip to initiate firmware upload. Manually pressing the reset button at this point doesn't work either while at all other times pressing the reset button successfully resets the chip.
Please also note that I am neither able to re-burn the bootloader because of wrong signature reporting.

I am now suspecting a faulty chip unless ....someone else can come up with another idea.

Thanks :slight_smile:

Sketch uses 24462 bytes (85%) of program storage space. Maximum is 28672 bytes.
Global variables use 1084 bytes (42%) of dynamic memory, leaving 1476 bytes for local variables. Maximum is 2560 bytes.
Forcing reset using 1200bps open/close on port COM11
PORTS {COM11, COM17, COM18, COM19, } / {COM17, COM18, COM19, } => {}
PORTS {COM17, COM18, COM19, } / {COM17, COM18, COM19, } => {}
PORTS {COM17, COM18, COM19, } / {COM17, COM18, COM19, } => {}

(deleted)

(deleted)

spycatcher2k:
When this comes up, try tapping the reset button once.

I did try that as explained in tge op. It didnt work either..

spycatcher2k:
What does it report?

Code 0x10 if i remember well...but i will check again and verify.

Just tried it again to make sure and this is what i get:

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: 4744608
         Firmware Version: 0.4611299
         Topcard         : STK502
Error while burning bootloader.
         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.

Regarding the upload error, make sure you have the correct port selected from the Tools > Port menu. The ATmega32U4 based boards will occasionally change their port number.

Regarding the problem burning the bootloader, please do this:

  • File > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK
  • Tools > Burn Bootloader
  • After the process fails you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
  • Paste the error messages in a reply here

So heres the output during bootloader burn:

Arduino: 1.8.7 (Windows 10), Board: "Arduino/Genuino Micro"

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega32u4 -carduino -PCOM24 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xcb:m -Uhfuse:w:0xd8: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 "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM24
         Using Programmer              : arduino
         Overriding Baud Rate          : 19200
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x15
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x15
         AVR Part                      : ATmega32U4
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         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  9000  9000 0x00 0x00
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 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: 4744608
         Firmware Version: 0.4611299
         Topcard         : STK502
         Vtarget         : 1.8 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

Error while burning bootloader.
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.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Update :
After numerous tests, I ended up downgrading my ide from version 1.8.7 baxk to 1.8.5 and suddenly everything works fine again.

By the way iam using arduino as isp programmer.

I know that the newest ide comes with another version of avrdude, but surely eveything should still be working....

After numerous tests, I ended up downgrading my ide from version 1.8.7 baxk to 1.8.5 and suddenly everything works fine again.

By the way iam using arduino as isp programmer.

For some reason it looks like IDE 1.8.7 is using avrdude -carduino which resets the Arduino used as a programmer.

"Using Port : COM24
Using Programmer : arduino
Overriding Baud Rate : 19200"

Ide 1.8.5 uses avrdude -cstk500v1 which does not reset the Arduino used as a programmer.

I have just started using a 10uf capicator between Rst and Gnd whenever I use an Arduino as ISP.

You can check the programmers.txt between the two IDE's to verify this.

The issue with the change from the stk500v1 protocol to the arduino protocol was reported here:

Then someone else has the exact opposite complaint here:

They both work fine for me with no capacitor to disable the reset so I don't know what's going on.

I used a Nano clone for over a year with the three Leds and a cable built from Gammon's site. It worked almost as well as a Usbasp . Then one day after sitting on an hourly build long enough to forget I had changed to it, my Nano went on the blink and it took me a long time to trouble shoot it. I am seeing people with experience running into the same thing. Worked last month on 50 chips and now you can't get one to program. :slight_smile:

One more thing to consider is that i was able to program a 1284p chip with mightycore with the same arduino programmer and ide 1.8.7! In this case a different programmer setting is chosen in the ide (arduino as isp mightycore)

The above had me thinking that the 32u4 chips had some sort of an issue. .

The "Arduino as ISP (MightyCore)" programmer still uses the stk500v1 protocol:

I finally found the pull request where this change was made:

It has a lot of information on why this was considered necessary. It seems to come down to the problem where you couldn't use an ATmega32U4-based board as an Arduino As ISP programmer. I made a workaround for this problem years ago by simply creating a new "Arduino as ISP(ATmega32U4)" programmer definition, which uses the arduino protocol:

My head hurts! :confused:

Works for Linux doesn't work for Win10.
Works for everything, works for nothing.
Works for Win10 sometimes.
Works for this Arduino doesn't work for the same Arduino at a different elevation. :slight_smile: