user47391: I have a hand-wired keyboard that uses a Pro Micro board, with an ATmega32u4 chip. I can't seem to flash firmware on it. The commands I've been trying are variations of: 
avrdude -p m32U4 -P /dev/ttyACM0 -c avr109 -U flash:w:atreus62.hex

The errors I've been getting begin: 
Writing | #######avrdude: error: programmer did not respond to command: set addr
####avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: write block
 ***failed;  
 ***failed;  
 ***failed;  
 ***failed;  

And end: 
#avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: set addr
#avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: set addr
# | 100% 0.16s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x0d != 0x0c
avrdude: verification error; content mismatch
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: error: programmer did not respond to command: exit bootloader

I'm on Arch Linux. Any ideas? 

user4143: There's two stages to uploading a hex file to a USB-based Arduino - and you're only doing the second stage.
The first stage is to reset the board into the bootloader so it can accept the instructions from the second stage.  The IDE normally does that manually for you when you hit the UPLOAD button.
The way these boards are reset is to first open the CDC/ACM port and set the baud rate to 1200, then close the port again. That triggers the code to reset the board into the bootloader.
You can probably do it using the stty tool in Linux:
$ stty -F /dev/ttyACM0 speed 1200
$ stty -F /dev/ttyACM0 speed 115200
$ avrdude -p m32U4 -P /dev/ttyACM0 -c avr109 -U flash:w:atreus62.hex

The second stty may not actually be needed, but it's good to reset the baud rate to a normal value ready for uploading. I don't have a board to hand right now to test it though.

user52445: I had the same issue, and it was caused by udev, I found the answer here
It's some obscure bug
Tweaking udev rules solved the problem for me, now all is good, here is the procedure: https://learn.adafruit.com/adafruit-arduino-ide-setup/linux-setup#udev-rules

47391: <p>I have a hand-wired keyboard that uses a Pro Micro board, with an ATmega32u4 chip. I can't seem to flash firmware on it. The commands I've been trying are variations of: </p>

<pre><code>avrdude -p m32U4 -P /dev/ttyACM0 -c avr109 -U flash:w:atreus62.hex
</code></pre>

<p>The errors I've been getting begin: </p>

<pre><code>Writing | #######avrdude: error: programmer did not respond to command: set addr
####avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: write block
 ***failed;  
 ***failed;  
 ***failed;  
 ***failed;  
</code></pre>

<p>And end: </p>

<pre><code>#avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: set addr
#avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: set addr
# | 100% 0.16s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x0d != 0x0c
avrdude: verification error; content mismatch
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: error: programmer did not respond to command: exit bootloader
</code></pre>

<p>I'm on Arch Linux. Any ideas? </p>
 4143: <p>There's two stages to uploading a hex file to a USB-based Arduino - and you're only doing the second stage.</p>

<p>The first stage is to reset the board into the bootloader so it can accept the instructions from the second stage.  The IDE normally does that manually for you when you hit the UPLOAD button.</p>

<p>The way these boards are reset is to first open the CDC/ACM port and set the baud rate to 1200, then close the port again. That triggers the code to reset the board into the bootloader.</p>

<p>You can probably do it using the <code>stty</code> tool in Linux:</p>

<pre><code>$ stty -F /dev/ttyACM0 speed 1200
$ stty -F /dev/ttyACM0 speed 115200
$ avrdude -p m32U4 -P /dev/ttyACM0 -c avr109 -U flash:w:atreus62.hex
</code></pre>

<p>The second <code>stty</code> may not actually be needed, but it's good to reset the baud rate to a normal value ready for uploading. I don't have a board to hand right now to test it though.</p>
 52445: <p>I had the same issue, and it was caused by udev, I found the answer <a href="https://learn.adafruit.com/adafruit-feather-32u4-adalogger/using-with-arduino-ide" rel="nofollow noreferrer">here</a></p>

<p><a href="https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1473246" rel="nofollow noreferrer">It's some obscure bug</a></p>

<p>Tweaking udev rules solved the problem for me, now all is good, here is the procedure: <a href="https://learn.adafruit.com/adafruit-arduino-ide-setup/linux-setup#udev-rules" rel="nofollow noreferrer">https://learn.adafruit.com/adafruit-arduino-ide-setup/linux-setup#udev-rules</a></p>
