I have an Arduino Duemilanove with an ATmega328. I am working on Ubuntu 12.04 (Precise Pangolin), and the Arduino IDE's version is 1.0. Recently, I tried to upload a few of the sample sketches onto it, such as the Blink one. However, none of my attempts are working and they result in the same error every time I try it:
avrdude: stk500_recv(): programmer is not responding.
I have enabled /dev/ttyUSB0 under menu Tools → Serial Port. I have also selected the correct board (Duemilanove with ATmega328) from the list. Yet, I am not able to resolve the issue. I have searched online as well and none of the other responses for this problem seem to be working for me. Why I am encountering this issue and how to resolve it?
I also tried turning the onboard ATmega and fitting it in the other direction. Now, I encounter no problems uploading, but nothing happens afterwards. The onboard LED also does not seem to be blinking.
I had this problem with a Crowduino, running the Arduino IDE on OS X. The solution for me was to switch on verbose output during upload (in the Arduino IDE preferences pane).
Then, when uploading, you can see AVRDUDE sending three packets avrdude: Send: 0 [30] [20] (with corresponding RX flashes on the board) right before the avrdude: ser_recv(): programmer is not responding error.
The trick is to hit the reset button on the board immediately before these three packets are sent. Then the program will be uploaded successfully.
I had the same problem – this is why I found this Question.
I only had to change the Processor from “ATmega328P” to “ATmega328P (Old Bootloader)”
Problem solved – at least for me.
Make sure that there is no input on the Tx/Rx pins. Then it will work.
There is some voodoo-talk in the answers around here among good ideas. Let's try to be a bit more real about what's happening and sum up the good stuff to check:
Basically, when that happens, it is a good idea to enable verbose mode for AVRDUDE, to get a better idea of what's happening. To do so, you only need to go in the preferences and check the verbose mode box. It's also a good idea to move away from the Arduino IDE, and launch a console to be more comfortable on reading AVRDUDE's output, that you'll get on clicking on the upload button.
What's important here to put 3 or 4 -v to the command call. Here's how looks like such AVRDUDE commands, with made up parameters as they are totally dependent on how the Arduino has been installed:
avrdude -v -v -v -v -C /path/to/avrdude.conf -patmega328 -P/dev/usbport -U flash:w:/path/to/firmware.hex
A good way to get the correct command line to use is to copy it from the verbose output of the Arduino IDE output log when verbosity has been enabled.
When you get avrdude: stk500_recv(): programmer is not responding, it basically means that something wrong is happening, before the flashing actually begins.
Basically you have to check (from hardware to software, low level to high level):
if the cable and/or connectors does not have microcuts;
if no solder points are short circuiting (i.e. touching something metallic around), that means:
if there is no short circuit on the PCB between Rx and Tx (usually pins 1 and 0);
if there is no contact with a metallic element below the board, or tiny bits between a component's legs (like the FTDI, the ATmega chip or any other);
if the ATmega chip is not out of power (GND/VCC shortcut or cut or VCC input being dead…);
if the 1 and 0 pins of the Arduino are not being used by some shield or custom design (/!\ does not apply to the Leonardo as it has independent USB handling);
if the USB to UART converter does not have a problem (FTDI on older Duemilanove or ATmega16U2 on newer Arduino Unos);
if the ATmega328 chip is fried or wrongly installed;
if the bootloader has been overwritten or is failing;
if the right baudrate is applied for entering the bootloader;
if the right settings are set for the target microcontroller and Board;
Usually the avrdude -v -v -v -v can help a lot find at which stage it is failing. Whether it can't make a USB connection at all (cable failing, USB/UART, PCB…), or it is a bootloader problem.
Update: I tried turning the onboard ATmega and fitting it in the other direction. Now, I encounter no problems uploading, but nothing happens afterwards. The onboard LED also does not seem to be blinking.
I'm afraid that if you reversed the position of the ATmega, and then it does not work, the fact that you placed the power source on digital pins may have burnt your chip.
Try to see if your board was selected correctly. Click on menu Tools --> Board and check if the correct board is select.
You can check if you have any jumper wires plugged into pin 0 and 1. Those pins are used for serial communication and plugged wires can prevent the code from being uploaded on the board.
If nothing is plugged, it might be a bug with AVRDUDE, you can try updating it.
I met this issue too, and I resolved it by re-installing USB serial driver. Pls see also:http://arduino.cc/en/Guide/Howto and http://www.ftdichip.com/Drivers/VCP.htm
Above error comes in 3 stages
If boot loader has been crashed
if you not selected proper port and proper board from IDE
If you communicating with other Serial port are connected.I.e GND and Tx pin are connected to other communicating device
I'm posting this because I didn't find this answer elsewhere.
All my Arduino nano chinese (CH340) clones had this problem after upgrading to the Arduino IDE to 1.8.9. What worked for me was to use a spare official Arduino Uno that I have to burn the bootloader on the faulty nanos using the ICSP headers on the nano. For this all I did was to follow the instructions here: chinese-clone-of-arduino-nano-with-chip-ch340g-how-to-fix-it. The ONLY thing I did differently was to always set the "Old Bootloader" option as said before in this thread. Other than that I completely followed the instruction on that link and saved my nanos from that annoying problem. I hope that this helps someone out there.
I had the same problem on my first trying of Arduino Uno.
My solution was quite simple. Just plug out then plug in the USB cable.
I solved the issue on OS X v10.10 (Yosemite) following these instructions:
FTDI chip and OS X 10.10
However the trick proposed by hoipolloi was a working temporary workaround, on this version too.
On Windows 7, I had this problem multiple times, each time with different error messages. Basically, the IDE is sending to the wrong port.
To fix this, simply go to menu Tools → Ports → [select the COM port that your board is on].
Make sure to double check your board's port:
Start Device Manager
Make sure your Arduino driver is listed under the port matching your IDE's port settings (mentioned above)
My board is listed under port COM1. If you want, you can simply change the port in the driver's advanced settings:
Thanks #hoipolloi for the right direction in finding the solution.
Anyway, I had to do a bit different steps to fix the issue.
In my case, the Arduino Uno had worked fine, but it suddenly stopped after some playing with sketches. I was receiving the stk500_recv(): programmer is not responding all the time and nothing worked. Then I paid attention that the LED 13 is always ON on my board. It looked like some hard looped sketch was running over and over on the board and was blocking any input to the board. Not sure, it's just my gues.
I tried clicking the RESET at all the possible moments without any luck and suddenly tried the following steps:
Unplug the board.
Click and hold RESET.
Plug it again.
Wait for a couple of seconds.
Release the RESET button.
After this I noticed the onboard 13 LED turned off for a second and then turned on again. It looked like there were a short reset window when the board is actually being reset. Then as in #hoipolloi's solution I caught the moment of "reset" right before the three packets are sent and that worked.
I hope this will help you to figure out the problem if none of other solutions works.
TIP. If you do not see the three Send: 0 [30] [20] lines when uploading the sketch in your console, do the following:
Click "Upload" in your Arduino IDE.
Look at the log window. You will be able to find a line like this:
E:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CE:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM3 -b115200 -D -Uflash:w:C:\Users\Sergey\AppData\Local\Temp\build44ca75bc60fd83cc8ef41e35d4d83388.tmp/sketch_sep07a.ino.hex:i
Looks like it swallows line break or space symbols like here -CE:\Program Files.... It should be -C E:\Program Files. Copy this like into Notepad, add missing spaces to make the line this:
E:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -v -v -v -v -C "E:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -patmega328p -carduino -PCOM3 -b115200 -D -U flash:w:C:\Users\Sergey\AppData\Local\Temp\build44ca75bc60fd83cc8ef41e35d4d83388.tmp/sketch_sep07a.ino.hex:i
Add 4 -v instructions like I did above.
Open the Command Line, paste the command into it and run.
Now you will see much more verbose thanks to 4 -v arguments. Originally, Arduino Studio uses just one.
I have this problem on my Arduino running on Mac also. It happens on two of my Arduinos (A Arduino Uno and an Arduino Pro connected with FTDI).
For the Uno, I hook the cable up to my computer and press upload, and then start counting until the "TX" LED flashes. Then repeat the upload, but just before the TX LED flashes, hit the reset button, and the upload succeeds.
I later determined that changing the USB cable fixed this issue.
Please do the following checks:
1- No wires in the TX and RX of your arduino while uploading the code.
2- No soldered pins in each others.
3- If 1 and 2 are okey than you must reinstall the bootloader into your arduino using another arduino, you can search how to do that in youtube there plenty of videos talking about it.
If you are connecting your Arduino through a USB hub, try to connect it directly into one of the USB ports on the Mac instead.
That worked for me.
First, ensure that /dev/ttyUSB0 works. E.g. plug in mouse and check it works.
Second, try select other board. It is often that non-original boards do not recognized correctly under their names.
Third, try press reset button manually while uploading sketch. Probably automatic reset is broken.
I solved a problem in my case by downloading and installing old FDTM drivers from here.
Try to install FTDIUSBSerialDriver_10_4_10_5_10_6_10_7.mpkg, then re-start Arduino.
Just thought I'd point out that my brand new
Arduino Uno Rev3 board uses the following
LInux driver:
Device Drivers
|-USB Drivers
|-USB Modem (CDC ACM) support
This is known as the: CONFIG_USB_ACM: option in the most recent LInux 3.x kernel.
This device then comes up as: /dev/ttyACM0 or similar.
Have you got anything connected to the RESET pin on the Arduino?
I've encountered this issue with a graphic LCD which needed connecting to the RESET Pin. Disconnecting the jumper wire between the LCD and the RESET pin while uploading the code fixed it for me, all you'd have to do then is reconnect once the code has finished uploading.
I found the cause of this...
Changing my serial port to /dev/tty.usbmodem2131 fixed it. It turns out I was using the wrong serial port this whole time!
You can try:
Check in preferences.txt serial.debug_rate:
serial.debug_rate=9600
Else try to hit the reset button of your Arduino just when uploading.
Else try to select another card in the Arduino IDE menu Tools and then reselect your card in the list.
This combination of the above answers solved the problem for me:
performed the Java update:
sudo apt-get install default-jdk
then killed the Arduino IDE and restarted it
my correct board now showed up (Arduino Mega 2560, where before Mega 1280 was only option)
for the drivers, I did this:
sudo chmod a+rw /dev/serial/by-id/usb-Arduino__www.arduino.cc__(a bunch of numbers)
After that, my Arduino IDE shows /dev/ttyACM0 in the tools/serial port menu.
Now, everything works great!
Here is a solution that worked for me running on a MacBook Pro (desktop).
I was getting the same error and it turns out it's because I had the USB connected to a peripheral device (my monitor) rather than a USB on the PC itself. It stopped any errors right away and is a simple solution.
I tried to connect my servo to the Arduino 5V pin, but the processor and that is why I got this failure
avrdude: stk500_recv(): programmer is not responding
Solution: buy a new Arduino and external 5 V power supply for the servo.
Did you install/update the driver for the FTDI cable? (Step three on http://arduino.cc/en/Guide/Howto). Running the Arduino IDE from my Raspberry Pi worked fine without explicitly installing the drivers (either they were pre-installed or the Arduino IDE installer took care of it). On my Mac this was not the case and I had to install the cable drivers in addition to the IDE.
I just spent the last few hours on this same issue... Just go here "http://www.ftdichip.com/Drivers/VCP.htm", download the latest drivers and reboot. Should work just fine after that. I also downloaded a nightly of the Arduino software, but I don't hunk that made a difference.
Try to load a program without -b (the baud rate option). In ~/.arduino15/preferences.txt set build.verbose=true, when arduino.cc is not running. In the verbose output you will find the hex file which you should load from a console:
avrdude -v -v -v -v -C/usr/share/arduino/hardware/tools/avr/etc/avrdude.conf -patmega328p -carduino -P/dev/ttyUSB2 -D -Uflash:w:/tmp/build2314497724350388190.tmp/sketch_nov13b.cpp.hex:i
I just replace the chip 128 with the 328 version and from Decimile my board name was changed to Uno or Ethernet due to the new baud rate 115200.
In my case the problem was raised when I was trying to do some "weird" arithmetic expressions
eg (3.14/4)/5 or 3.15%2.55
So, I would suggest you to check all the arithmetic expressions in case some of them cannot be calculated by the Arduino.
Hope it helps.
In my case (Mini Pro), solution was so simple, not sure how I missed that.
I needed to crossover rx/tx wires.
Solution:
Arduino Rx pin goes to FTDI Tx pin.
Arduino Tx pin goes to FTDI Rx pin.
Related
I bought esp8266 with serial wifi wifi card
I connect RX to TX; TX to RX; VCC to VCC; GRD to GRD;
I cant communicate with the board not if program mode and not in UART mode; the reset do nothing.
the red led on the board is on.
I connected the wifi serial to Arduino uno board.
try to upload sketch i got the following error:
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
Any help or guides will help me to solve the issue.
Since I have had numorous of problems with my ESP8266 modules, this is what I generally watch for:
Output is 3.3v
Swap over tx and rx. Some boards have them swapped for some reason (searched for days for this!!)
When uploading the code, first the code compiles, then the code uploads. During the compile process, keep the reset button (or pin) pressed. As soon as you see the "uploading" status message, you can release it.
Make sure the GPIO0 is connected to the ground and (depending on which version you have) the GPIO15 as well.
When grounding the GPIO0 and GPIO15, use a resistor for each (between 2K and 10K will do).
I've spent two nights trying to upload firmware so I'll just repeat what helped me since there's not so many solutions:
First in Serial Monitor make sure that your chip responses to AT commands. There's no point in going further without achieving it. If you fail here then it's time to check your commutation, power source, etc.
While uploading: 1. Ground GPIO-0 pin. 2. In Arduino IDE press Upload button. 3. Code starts compiling. 4. As soon as you see that code starts uploading ground RST pin for just a blink. Before I reseted the chip too early so I had sync failed problem as you did. It took me a while to "catch" this moment for resetting the chip. Still I upload new firmware in 4-5 takes.
Before flashing firmware, please hold FLASH button, and press RST button once. When our firmware download tool released, it will flash firmware automatically and needn't press any button
I have this really weird issue where grounding GPIO 0 didn't work for me, but after a lot of trial and error I managed to upload the sketch connecting directly both gpios to ground in the arduino board and it worked. Really strange.
I had the same issue. In my case, I was uploading while in another terminal program I was checking for serial data. After I closed the serial monitor (and let Arduino IDE use the serial port) the problem was resolved partially.
The other half of the problem involves carefully pressing the button GPIO0 and then RESET.
This helped me achieving that.
I had the same issue, but after I set the Programmer to "AVR ISP" in the Arduino IDE/Tools, after that the upload was successful and it worked fine.
Hope it helps.
First you have to make sure that the Arduino IDE has the ESP8266 libraries installed. To do that, go to file>preferences and under Additional Boards Manager URLS, paste this link:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
Then, go to tools>board>boards manager. Scroll until you find the link for ESP, than download it.
Once you select all the info for the board change the programmer to "AVR ISP"
Finally, to download the code, hold down the GPIO0 button and press the reset button once. Finally, hit download!
To use serial monitor, you may need to use the 115200 speed as it is not the default.
Hope this helps!
Please downlode and install these driver as per OS i spent 6 hours today and finally this was the solution.
https://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx
Look follow the leads and you will get the proper output as 'OK' in reply to AT command, just search for Arduino15 file in C directory of your computer, it will be in somewhere at C/users/app data and delete it, then set the Arduino to arduino uno board or whatever board you are using and connect the Esp8266 as, UNO --- ESP8266
RX ----- RX
TX ----- TX
GND --- GND
3.3V --- VCC and CH_PD
Once Connected open the Serial Monitor and set "Both NL & CR" and Baud to 9600.
Send "AT" to test. If nothing comes up try different baud rates such as 115200 or 57600 and retest.
If you get "OK" reply then all is working.
I just bought the Wemos D1 and had the same problem: I could not upload my sketches. There were several reasons for this:
1) I did not have the CH340G drivers loaded on my Mac. Both Win and Mac platforms need these drivers. Linux does not. I found my drivers at http://sparks.gogo.co.nz/ch340.html
2) You need to add the board to your Arduino IDE. You can find the steps to do that at http://www.beerandchips.net/2016/01/24/wemos-d1-hands-on-with-the-new-arduino-compatible-esp8266-dev-board/
Once I completed those 2 steps (be sure to select the serial port) everything worked great and I can upload my sketches with no difficulty.
I had (too many/wrong) COM port(s). Find the right one and I't fine.
This worked for me this time in the following way to successfully upload sketch from IDE to esp8266 via arduino:
1) IDE Tools menu: upload speed 115200
2) opt this one in tools menu: Programmer- AVR ISP
3) Keep serial monitor closed. If com port not visible under Tools, disconnect and reconnect USB from laptop
4)Reset Arduino
5)Connect GPIO0 of 8266 to VCC(3.3V) for a blink and remove
6) Connect reset of 8266 to gnd for a blink and remove
7)GPIO0 grounded..keep this one gnded for the upload period
Hope this one works..
i got a brand new Teensy 3.2 with the blinking LED programm on it.
When I now tried to upload another programm on the teensy, Arduino says:
Teensy did not respond to a USB-based request to automatically reboot.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.
The automatically starting window of Teensy, doesn't give me a chance to (for example) reboot the Teensy as well, so something of the connection seems to be wrong or something, but what...
Even if I mannualy press the pushbutton, it's still not possible to upload something. Any ideas why?
I have encountered this problem twice. The first I tossed out the board. This time, when I power it, it runs the last program I burned on it, but when I try to program it again, the LED stops blinking and everything stops.
The claim that it might not be a data cable is not reasonable, because how can it stop the current program unless it was told to. I doubt very much that +5V can provide such commands.
I have tried different cables, different USB ports, rebooting my Linux box, reinstalling (twice), checking the pins on the Teensy and the cable... no clue.
It always boots up in the old app (I left the blinker running to indicate "liveness"). I had programmed a message to come out the hardware serial port. Could that have been the problem? Wait... Is there a way to set the baud rate on the USB? I wonder if that is the problem! --
Banner(void) {
Serial.begin(9600);
Serial1.begin(115200);
};
The example had me programming the USB serial! I bet that is the problem! Better yet, does anyone know what the protocol is for talking to USB serial commander?
Under Ubuntu 18.04 install this https://www.pjrc.com/teensy/49-teensy.rules file into /etc/udev/rules.d
I have an Arduino Uno and I am using arduino 1.0.5 IDE. I followed he procedures for bootloading an atmega328P-PU on a breadboard.
I uploaded the ArduinoISP sketch first, made the connections(using the External Oscillator) and then wired it up. Then, I selected the programmer as Arduino as ISP, selected the board as Arduino duemilanove w/ Atmega328P. Then I selected the correct serial port and clicked Burn Bootloader.
I got the following errors:
avrdude.exe: stk500_program_enable(): protocol error, expect=0x14,
resp=0x50avrdude.exe: initialization failed, rc=-1 Double
check connections and try again, or use -F to override
this check.avrdude.exe: stk500_disable(): protocol error, expect=0x14,
resp=0x51
How to solve this issue? Also, can I upload the bootloader directly by using it on the Uno in place of the original chip. If so, how?
to my understanding the error you have indicates a bad reading from the chip. I experienced that with chips that were either dead or not properly connected, especially to power supply.
You may find more detailed information in th tutorial : https://www.arduino.cc/en/Tutorial/ArduinoISP
Especially those things :
Note for Arduino 1.0: you need to make one small change to the
ArduinoISP code. Find the line in the heartbeat() function that says
"delay(40);" and change it to "delay(20);".
Select the items in the
Tools > Board and Serial Port menus that correspond to the board you
are using as the programmer (not the board being programmed).
Instead of arduino built-in boot loader just go through below link and it will be great for uploading boot loader and verifying board status info
I am replying you this because same issue I got long back and it saved me.
One more thing for arduino boot loader: for atmega328 you need to put capacitor between reset and gnd( in case you missed)
For gammon bootloader you don't need it.
Be Innovative.
For reset line you might me using 100nf(thats what stated in documentation )...but sometimes it doesn't work...try something like 4.7uf, 22uf or 47uf or close values
I had a similar problem and the issue was that my programmer was a bit slow, I used the -B flag for avrdude to slow down the bitrate and it started working, I set the -B20 and works like a charm every time, but I use the USBTinyISP programmer, not the stk500 one, so this might not work for you.
In case someone stuck at this as I did and nothing like changing the cap value helped. Make sure you are using your USB-TTL adapter in a 5v mode (obviously for a 5v powered chip). I always used it in a 3.3v mode in order not to accidentally burn my 3.3v chips and it always worked. Until today, I was trying to flash my custom atmega8 board and everything worked with the ISP but I was having a hard time using the bootloader and after half a day searching and trying different stuff the 5v setting to the rescue.
My Arduino Uno was all set up and was working fine.
Project: Arduino controls a 9v motor depending on the command given. As the Arduino only provides 5v, I added a 9v battery to it through a transistor
I decided to add new code into the Arduino but when I tried it failed. I have uploaded code thousands of times before (successfully) all of a sudden the IDE keeps giving the following message
avrdude: ser_open(): can't open device ".\COM3": Access is denied.
I have looked up for a lot of solutions on this forum and elsewhere. Here are the things I have tried so far:
Changing the COM port
Disabling all the other devices CONNECTED to COM
Tightening the CONNECTIONS
Re installing all the drivers and the IDE
Rebooting the system
Using another laptop to upload code
All the above have given me the same output for some reason. The built in LED light and the power LED switch on when the board is connected to a power source (my laptop). Could the board have been damaged by any chance? How can I check if the board is spoilt? Should I buy a new board?
this may help;
remove the mcu from the board and connect the board to your PC.
try to open the com port.
if it opens, short TX pin to RX pin.
send some data and check if you are getting the data back. this way you can make sure your usb-ttl is not damaged.
With my verry limited experience with Arduino I've seen that the IDE sometimes resets the saved arduino on startup. Press extra -> Board -> yourboard and try again.
make sure you have the right ports COM1 and COM1
activate it too in arduino
Once it happened to me that a defective USB cable was the culprit. For one board it gave messages like
avrdude: stk500v2_ReceiveMessage(): timeout
But for another board I also got these messages "can't open device - access denied". It's always worth to try another cable.
This is the main error that I get when I try to run my ARDUINO program. The full list of errors is as follows:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
My code is as follows:
int led=13;
void setup()
{
pinMode(13,OUTPUT);
}
void loop()
{
digitalWrite(13,HIGH);
delay(1000);
digitalWrite(13,LOW);
delay(1000);
}
I have tried updating the drivers (they are fully updated) and downloading some programs. I have Windows 7 and my arduino is a MEGA 2560. It shows up in the Device Manager and all of my connections are correct. The green PWR light is on and so is the flashing L light. The RX and TX lights flash when I update. I have tried almost everything on the web. What is the problem?
Another possible reason for this error for the Mega 2560 is if your code has three exclamation marks in a row. Perhaps in a recently added string.
3 bang marks in a row causes the Mega 2560 bootloader to go into Monitor mode from which it can not finish programming.
"!!!" <--- breaks Mega 2560 bootloader.
To fix, unplug the Arduino USB to reset the COM port and then recompile with only two exclamation points or with spaces between or whatever. Then reconnect the Arduino and program as usual.
Yes, this bit me yesterday and today I tracked down the culprit. Here is a link with more information: http://forum.arduino.cc/index.php?topic=132595.0
The error message basically means that the programmer is unable to contact the bootloader on the device; the code you're trying to upload has no bearing on the problem.
What causes this can be numerous and varied, some possible issues:
UART communications
Blinking is happening, so hopefully you aren't using the wrong port. It might be worth checking again though, sometimes USB COM devices install on strange port numbers.
Connect TX to RX (and disconnect them from the AVR if possible) then open a terminal on the COM port, you should see characters echoed if you type them. If you don't, something is wrong up-stream of the chip, it could be the communications chip (I think the Arduino 2560 uses a secondary AVR instead of an FTDI for some reason, so that could be broken, either its software or hardware)
ATmega* bootloader
The AVR is not executing the bootloader for some reason. If the programmer is not resetting the micro before attempting to connect, this might be the reason. Try to reset the AVR (press and release the button) while the programmer is attempting to connect. Sometimes software that runs in a tight loop will prevent the bootloader from connecting.
Barring that, the fuses might have gotten messed up or the code erased. You would need to reflash the bootloader and proper fuses, again, see the appropriate info page for your device.
Arduino Mega 2560 only: ATmega8U/16U software
Might not be working and would need reprogramming. See the Programming section on the info page, you will need the firmware and Atmel-compatible DFU (device firmware update) software on your computer to reflash the target.
Hardware damage to the board, AVR(s), or FTDI chip
You're hosed; need a new chip.
Check this forum post for some more ideas.
I got this error because I didn't specify the correct programmer in the avrdude command line. You have to specify "-c arduino" if you are using an Arduino board.
This example command reads the status of the hfuse:
avrdude -c arduino -P /dev/ttyACM0 -p atmega328p -U hfuse:r:-:h
To my humble understanding, this error arises in different scenarios:
you have selected the wrong port or you haven't at all. go to tools > ports and select the com port with your Arduino connected to.
you have selected the wrong board. go to tools > board and look for the right board.
Do you have one of these Arduino replicas or you don't have the boot-loader installed on the microcontroller? I don't know the solution to this! if you know please edit my post and add the instructions.
(windows only) you don't have the right drivers installed. you need to update them manually.
sometimes when you have wires connected to the board this happens. you need to separate the board from any breadboard or wires you have installed and try uploading again. It seems pins 0 (RX) and 1 (TX), which can be used for serial communication, are problematic and better to be free while uploading the code.
Sometimes it happens randomly for no specific reason!
There are all kinds of solutions all over the internet, but sometimes hard to tell the difference between magic! Maybe the Arduino team should think of better compiler errors to help users differentiate between these different causes.
The same problem happened to me and none of the solutions above worked. What happened was that I was using an Arduino UNO and everything was fine, but when I bought an Arduino Mega 2560, no matter what sketch I tried to upload I got the error:
avrdude: stk500v2_ReceiveMessage(): timeout
And it was just on one of my windows computers and the other one was just ok out of the box.
Solution:
What solved my problem was to go to tools > boards > Boards Manager... and then on the top left of the opened windows select updatable in the Type section. Then select the items in the list and press update on the right.
I'm not sure if this will solve everyone's problem, but it at least solved mine.
Open Terminal and type:
$ sudo usermod -a -G dialout
(This command is optional)
$ **sudo chmod a+rw /dev/ttyACM0**
(This command must succeed)
This isn't really a fixing solution but it may help others. Unlike Nick had said for me it was due to code in my program. I have the mega ADK model. The issue was tied to a switch statement for processing and parsing the returned byte[] from the usb connection to the Android. Its very strange because it would compile perfectly every time but would fail as the OP had stated. I commented it out and it worked fine.
I was running this code from Arduino setup , got same error resolve after changing
serial port to COM13
GO TO Option
tool>> serial port>> COM132
If you use the ino command line:
ino upload
it can be because you use the arduino software at the same time, try to kill it.
I've connected to USB port directly in my laptop and timeout issue has been resolved.
Previously tried by port replicator, but it did not even recognized arduino, thus I chosen wrong port - resulting in timeout message.
So make sure that it is visible by your OS.
Ensure the serial monitor is not running and nothing is reading/writing dev/tty/S0 (or whichever port you're using), which may cause uploading interference.
I had the same problem, and in my case, the solution was updating the usb-serial driver using windows update on windows 10 device's manager. There was no need to download a especific driver, I just let windows update find a suitable driver.
I faced same problem. but Root cause of issue. Incorrect communication was set and thats why I occurred Communication timeout.
Solution: If you connected to laptop through USB port.
Change Port as USB. Please follow steps
Open Arduino-IDE
Go to Menu "Tools --> Port" and Select option "USB" { for me its showing as /dev/ttyUSB0 }
It working fine for me.
Something not yet mentioned is that this message also appears when the baudrate is not properly set... for Arduino, it is generally 115200.
My aurdino mega 2560 returned same error. It seems the problem exists in unofficial clones. The issue solved by pressing reset button just before uploading starts, as advertised in following video.
https://www.youtube.com/watch?v=tAzjO4v7oF4&list=LLDn5ewJDzz53IiwWmZTgQnQ&index=1