1

I have a strange problem. I am trying to upload a .hex file to my lovely Arduino Pro Micro, but am unable to do so. If I use the Arduino IDE, it goes through perfectly fine and uploads the sketch. However, if I try to use avrdude from the terminal I get:

avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader

My commandline is:

avrdude -patmega32u4 -cavr109 -P/dev/ttyACM0 -t

and the full output is:

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

avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = ""; type = 
    Software Version = .; Hardware Version = .
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

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

avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = ""; type = 
Software Version = .; Hardware Version = .
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: butterfly_recv(): programmer is not responding
    avrdude: error: programmer did not respond to command: leave prog mode
    avrdude: butterfly_recv(): programmer is not responding
    avrdude: error: programmer did not respond to command: exit bootloader

Thank you for any help, it is greatly appreciated.

--Dominic

  • The programmer is wrong. You don't have avr109 bootloader, enable verbose upload from the IDE and copy-paste the command it used. – Avamander Mar 13 '16 at 14:59
  • That is what I did. Also, the chip on my Arduino says "MEGA32u4" right on it... – KilowattLaser Mar 13 '16 at 15:35
  • Oops, I read it as Pro Mini not as Pro Micro. – Avamander Mar 13 '16 at 16:19
1

Unlike the 328P and similar boards the 32U4 has no hardware method for triggering a reset to enter the bootloader.

On the boards with a UART -> USB interface the USB interface chip manually toggles the RESET pin to activate the bootloader. Without that chip a reset can't be done.

So a different method had to be invented. That method involves opening the serial port at 1200 baud and immediately closing it. That triggers a reboot into the bootloader.

The Arduino IDE manually performs that task when you press the upload button. It is not something that avrdude knows how to do.

So you will have to come up with some method of opening the serial port at 1200 baud immediately before running avrdude. Of course, it means the serial interface device disappears for a short while whilst the chip reboots and enters the bootloader, so you need to ensure you have a delay between the reset method and the call to avrdude - a delay that is long enough for your OS to redetect the chip, yet not so long that the bootloader times out.

  • Excellent! Thank you. I reset the board manually to test it, and I was able to upload my hex file normally. – KilowattLaser Mar 7 '16 at 19:09
0

I had this bizarre problem with my Leonardo and Uno boards. I was even using Arduino IDE (v1.8.5) to upload the code. In some extreme circumstances, one of the boards was not even listed under serial ports (Tools->Port)

After many attempts I simply burned bootloader using another Uno, and that solved the issue!

It is still unclear to me what happened but the issue was caused by an RFID card reader using SPI (ICSP pinouts on the board). The card reader (PN532) was sending data to Arduino when either I was uploading the code or the board was booting up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.