Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVRDUDE command line can't connect to programmer for Leonardo

I am trying to connect to an Arduino Leonardo from the command line using:

./avrdude -patmega32u4 -C../etc/avrdude.conf -cavr109 -P/dev/cu.usbmodem1421

I get a series of the following errors:

avrdude: butterfly_recv(): programmer is not responding

This seems to indicate that the board is not kicking into bootloader mode. I've tried to force bootloader mode by double tapping the reset button during upload, but to no avail.

How can I fix this?

like image 518
Trevor Shaw Avatar asked Oct 18 '17 14:10

Trevor Shaw


1 Answers

As per the page Arduino Leonardo upload from Makefile I need to trigger bootloader mode by making a serial connection with 1200 bit/s and then immediately disconnecting.

The reason I wasn't able to make this work by tapping the reset button is that the Leonardo often grabs a new serial port name when it resets, so I would enter bootloader successfully, but when I went to flash, the port in my command line was no longer valid.

like image 62
Trevor Shaw Avatar answered Oct 22 '22 13:10

Trevor Shaw