0

I'm trying to use a Nano as an Arduino as ISP programmer in Arduino IDE 2.x, and it's not working.

In v1.8.19 of the Arduino IDE I select the comport the Nano appears as, select "Arduino as ISP" For the programmer, select "Arduino Micro" as the board to flash, and then select "Tools -> Upload Using Programmer". My sketch is compiled, the IDE connects to the Nano, and the flash proceeds as expected and completes successfully.

In v2.3.6 of the Arduino IDE (or in VS Code using the "Arduino Community Edition" extension) when I try the same thing with the same steps, the flash fails. It appears avrdude is being told to use a different flasher than what I've selected ("Arduino as ISP") in both cases and I can't figure out what to do to straighten this out so I can move forward using the newer toolchain.

The successful output from the older Arduino IDE looks like this when it starts the process, after building the sketch:

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

     System wide configuration file is "C:\Users\[REDACTED]\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM9
     Using Programmer              : stk500v1
     Overriding Baud Rate          : 19200
     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 : 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

The failed output from both VS Code and the Arduino 2.x IDE looks as follows:

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

     System wide configuration file is "C:\Users\[REDACTED]\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM9
     Using Programmer              : avr109
     Overriding Baud Rate          : 57600
     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 : butterfly
     Description     : Atmel AppNote AVR109 Boot Loader

     Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding

I'm also mildly confused about why selecting "Arduino as ISP" shows it using the STK500 when it works, but if I select STK500 from the list of available programmers, it fails. No matter what I select in the Arduino 2.x IDE or in the VS Code extension, it seems to always want to use this "butterfly" programmer, which I've never heard of and always fails.

EDIT: Removed irrelevant comment about what I'm trying to flash with the Arduino as ISP setup.

New contributor
alzee is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

1 Answer 1

2

try the same thing with the same steps

In short, the mention of AVR109/Butterfly in the output contradicts this.

Somehow you're not choosing the "Using Programmer" version of Upload when you're in the 2.X IDE. I can't make sense of that if you're actually clicking this menu (or using its shortcut) in the 2.X IDE.

IDE with "Upload Using Programmer" menu selected

Old IDE will accept a shift-click on the toolbar's upload button for "Using Programmer". The new IDE does a normal bootloder upload irrespective of whether shift is held. For those of us who have used the shift-click feature a lot, this is probably the easiest way to cause this problem and be confused about how.

I don't know anything about the VScode Arduino Community Edition extension. But, if you can see it executing arduino-cli command-line, you will see a -P or --programmer naming arduinoasisp in the case (and only in the case) that you've succeeded in asking VScode/extension to do the correct thing. Well, either that or you'd see a --profile that mentions the programmer.


No matter what I select in the Arduino 2.x IDE or in the VS Code extension, it seems to always want to use this "butterfly" programmer, which I've never heard of and always fails.

     Programmer Type : butterfly
     Description     : Atmel AppNote AVR109 Boot Loader

AVR109 is the name of a bootloader/programmer protocol. "Butterfly" was the name of a board that used this protocol or rather a protocol related to it. The only way you'd see AVR109 in the output is if either a programmer or board was selected that uses protocol. Not coincidentally, it is the protocol used by the Arduino Micro boards.txt entry. In this context it is strong evidence that the IDE is doing a normal (non-"Using programmer") upload to the Arduino Micro.


I'm also mildly confused about why selecting "Arduino as ISP" shows it using the STK500 when it works, but if I select STK500 from the list of available programmers, it fails.

Stick with "Arduino as ISP" because it is simply correct for what you're doing.

As to why, I'm not sure. But my best guess is that because of a difference in baud rate. "Arduino as ISP" specifies a baud rate of 19200. "Atmel STK500 development board" doesn't; I haven't looked into what rate, if any, it sets by default. The two entries are also different in that the Arduino as ISP will not try to probe for a STK500V2 programmer that you don't have before trying the correct protocol. I doubt that matters, but the only other possible (never mind likely) relevant difference I can think of between the two.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.