Question: I tried to upload my code to an Arduino Leonardo through theArduino IDE, but:

```
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 = h.; Hardware Version = u.M
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
avrdude: error: programmer did not respond to command: exit bootloader

```

What is wrong? How do I fix this?

Answer: 
There are some tips:
--------------------

* This is very often error message when you using damaged cable to upload your code. Try it with another cable.
* If you are using *AVRISP mkII* try to switch to *USBasp*
* Check if you have current version of Arduino IDE.
* Check your circuit. It could effect the communication.
* Go to the Board manager :

[![Board Manager in Arduino IDE](https://i.stack.imgur.com/ow76p.png)](https://i.stack.imgur.com/ow76p.png)

Than select latest version of support of your board and click install button.

[![enter image description here](https://i.stack.imgur.com/RMQY4.png)](https://i.stack.imgur.com/RMQY4.png)

* You can try burn new bootloader:
	1. After connect the AVR-USBASP from your computer to the arduino board, open the arduino IDE and click on Tools menu and under the Programmer sub-menu select USBasp. **Be sure that USBasp driver is installed!**

[![Select USBasp as programer](https://i.stack.imgur.com/ZqOHj.png)](https://i.stack.imgur.com/ZqOHj.png)

2. Then, click on the Burn Bootloader to start burning the bootloader under Tools menu.

[![Burn boot loader](https://i.stack.imgur.com/VOYGU.png)](https://i.stack.imgur.com/VOYGU.png)

3. After few minutes the Arduino IDE should show this message:

> 
> Done burning bootloader
> 
> 
>
I had the same problem and it seems it was because the global variables were taking up too much memory space.
I managed the upload through the following actions:
1. Reduce sketch size (<60% dynamic memory is ok)
2. Connect the USB cable just before the upload starts.
Doing this, the problem went away.
(I am using a Leonardo beetle board)