Mega2560: timeout communicating with programmer

Hi everyone,

I hope I'm posting this on the right board. I actually searched the forum here and various other forums online and found several people have had this problem, but I couldn't find one definite solution.

The project I'm working on right now has several actuators and motors that I've been interfacing one at at time and testing with my Mega2560, and it had been working perfectly fine.

The program uses the Mega as a "slave" to the computer waiting for serial communication to send a "keystroke" to the board and from there actuate motors in various predefined cases. It had been working until yesterday when I tried to flash it again and an error message came up saying that there was a timeout communicating with the programmer.

I googled it, and saw that one of the fixes that popped up was to:

"Edit your boards.txt file and change
From:
mega2560.upload.protocol=stk500v2

To:
mega2560.upload.protocol=wiring"

As found here: http://arduino.cc/forum/index.php?topic=115010.0

I went to change it, it was already changed in my .txt file. I kept looking around, but I couldn't find anything that seemed applicable to what I was experiencing.

Can anyone help?

I'm running an Arduino Mega2560 on Windows 7 through the Arduino 1.0.2 IDE.

The outputs were:

Using Port : \.\COM10
Using Programmer : wiring
Overriding Baud Rate : 115200
avrdude: wiring_open(): releasing DTR/RTS
avrdude: wiring_open(): asserting DTR/RTS
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]

[then avrdude: Recv: .....[every letter on my serial message to be displayed]

avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude done. Thank you.

I'm pretty worried, because I have to have this done in time by Wednesday.

Thanks in advance,

Dangerzone812

You may be experiencing the "!!!" problem.

The original bootloader would us !!! as an escape sequence to enter a special mode.

If !!! , three or more exclamation point in a row are received during the bootload it will enter that mode and will no longer respond to bootload commands.

If you have entered any strings with !!! then you can remove them and this should fix your problem.

1 Like

I'm having the same problem. No !!! in my code and I was uploading fine, then it started giving me the same timeout error

avrdude: stk500v2_ReceiveMessage(): timeout

For a while, just unplugging the USB and plugging it back in would allow an upload, now it won't upload at all. And I did that, though it was a pain in the neck.

Grrrr. Frustrating, I'm wondering if I made the wrong choice in getting this Arduino instead of another micro controller.

1 Like

Hi, I was a few days testing with the code. I removed a paragraph and no timeout avrdude problem, but I did not see the problem. I have read this thread and this was the solution. No !!! in my code and I was uploading fine.

Thanks!!!

Did anyone ever find a solution to this problem? I've tried replacing the AVRDUDE.EXE, modifying the the boards.txt to "wiring" programmer, and searching around the web. Nothing seems to work. My mega worked great for 2 days, then suddenly, nothing would upload; not even the simplest little program.

Arduino Mega 2560 and Windows 7 64bit

Same issue, no one to help us?

Arduino sucks!

2 Likes

Hello, I'm having this same problem except I can't upload blink... seriously, blink!

I'm using windows 7 and arduino 1.0.3. I've tried uploading blink onto my rambo (mega2560) and another ordinary mega2560 and neither will complete the upload.

I then checked the troubleshooting guide in the Arduino help and followed the advice.
In my case I noticed that whether or not I had the arduino plugged in, COM1 was still available in the serial ports. From there I went to Control Panel --> Hardware and Sound --> Device Manager. In there I found that the mega boards were popping up as unknown devices so I pointed win7 at the driver directory in C:/Program Files/Arduino 1.0.3/Drivers and voila... blink uploaded.

The answer, at least for me, was to follow the Arduino troubleshooting guide found in the help menu of my arduino IDE.

For the protocol "wiring" got to work it is necessary to connect the "RESET-EN" pads on the board. This was the mistake in my case (Mega2560 R1). I had ripped the connection one or two years ago, have forgotten that, and now with new development software versions the uploading have that strange timeout problems although the wiring protocol was configured by default.

Wise versa for the software patch of avrdude (stk500v2.c, described here: Upload Timeout Error on Mega 2560 - Not Sure What Changed - #18 by system - IDE 1.x - Arduino Forum) it is necessary to take/leave the protocol "stk500v2" to take effect of patched program.

Good luck, Thomas

I simply unpluged the board waited for around 20 mins and everythings ok again

1 Like

I know this topic is a little old, but I just ran into the same issue, tried everything suggested above and then some, including reinstalling drivers, checking physical connections on the board, rewriting fuses. I was able to fix my problem by reburning the bootloader. I used an AvrISP MKII to burn the stk500boot_v2_mega2560.hex file (located in arduino-1.0.3\hardware\arduino\bootloaders\stk500v2). I used Atmel Studio, but I'm sure you can burn the bootloader a number of different ways. Hope this helps anyone still looking for a solution.

-Jake

1 Like

kluonius:
I simply unpluged the board waited for around 20 mins and everythings ok again

the only answer that i understood worked , that was a close one phew. honestly only waited 20secs tho.

1 Like

I had this problem, and I just choose the right COM port (COM4 or COM5), and it's ok.

I have an another board, Duemilanove. This has a problem too. It was a "No driver" problem. Just update manually, and the upload works.

To Whom It May Concern,
Yes I am also interested in what causes these timeout errors. Seems this arduino stuff is riddled with a lot of hype with no real support or fixes available but they continue to sell the 2560 mega's along with all the shields which is well known to have bugs, or so I've been told. I sure hope someone can prove my assumption is wrong. Is there any support for this?
Regards
jessey

1 Like

Had this same issue. In my case I had a Elechouse MP3 shield plus a speaker attached to my Arduino Mega - all of which was powered through my USB connection on my laptop. I could hear the typical Windows sound when you connect a USB device letting you know it's installed. Then a few seconds later (after the MP3 shield auto played the saved MP3) I heard the typical Windows sound when you disconnect a USB device.

I think it was drawing too much power from the USB port and the USB port protection shut it down. Anyway, once I removed the shield and only connected the Arduino, I was able to upload fine

Hi aquateen,
I was thinking the same thing and did buy a transformer powered multiple outlet USB hub and will try it. I will get back here to let you know and anyone else that might be interested if it helps.
Thanks
jessey

I also have the same problem. I was testing my programme (it is about turning on a brushless motor with a battery and changing it velocity and measuring the motor voltage and current) when I streched out the batteries. Then I noticed the programme did not work any more. And now when I try to upload any kind of programme (I also tried to upload an empty programme) this error appears:

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

I tried all the things you mentioned here...

Hello all,

same problem here.

I have tried it on Windows, which is just "my old OS" I use for certain other software, and I also did try hard on a Ubuntu-Machine.
This is the result:
avrdude: stk500v2_getsync(): timeout communicating with programmer

I also have to agree that it is quite frustratiing to see that this threahd exists about 2 years now and, although we are in the support corner of the Arduino project, noone had an answer, or, if one had, it never made to this thread.

However,
I would like to get rid of this error message anyhow and I appreciate any help.

Thank you, folks.

Ok, after one week of fiddeling around, I can that i fixed it.

Problem was:
I didnt make it to upload anything to my MEGA2560 clone I bought here:
http://www.ebay.de/itm/MEGA-2560-R3-ATMEGA-Board-mit-USB-Kabel-compatible-Arduino-MEGA2560-D84-AR01002-/271319684513?pt=Wissenschaftliche_Geräte&hash=item3f2be9d5a1
(It is a online shop located in Germany, run by a chinese with excellent knowledge in German language.)
Because the 16u2 bootlaoder wasnt installed, or wasnt installed correctly, uploading to the 2560 was impossible.
Trying to use a Teensy 3.0 as my programmer, uploading obviously ran into timeout.
I even powered the MEGA board from a differend power source, but even this did nothing helpful, i thought. (I have read anywhere that might help to fix the timeout due to too much power drawing from my USB port.

What I finally did:
I researched the net for solutions, but didnt find anything helpful at the beginning.
Today i stumbled over this helpful site:
http://letsmakerobots.com/node/35649

I folled all the instructions from this helpful site, which means that I made a cable according to this graphic:
made by www.pighixxx.com (CC)
Note that i wanted to upload the bootloader onto the 16u2, wich corresponding pinout is located in the upper right corner of this pdf file, and NOT to the 2560 itself.

I now tried to upload the boolader many times, with differend versions of Arduino software (1.0.1 and 1.0.5) but always the resulting IDE message was "timeout" .

After a whole day I was too frustrated to just give up and also plugged the MEGA into another USB port on my desktop PC and...
voila...

IT WORKS.

I assume that the timeout message is a fake message anyhow. (I dont know that much about MC, Arduino software, programming, USB ports, transfer rates, and so on)
But at the end I am able to upload sketches to the MEGA like there was never a problem before. It just works fine.

I now have both, the Teensy3.0 and the MEGA attached to my PC running Ubuntu and the Arduino 1.0.5, both habe a blink sketch running and verything works fine. -After 5 days and a friday night infront of my screen.
Typing is quite difficult right now.

If anybody needs more help, just drop a line, maybe i am able to explain certain things more detailed as just above.

Happy uploadings.

I was having a problem with the mega2560 and am ready to toss the 3 mega boards in the garbage because it's just not worth the hassle to get them to program properly and no one has a solution to the problem that's doable for me. I regret buying the mega's now but I do like arduino and if the other micros like the uno or mini (actually there are quite a few different ones) work for programming then to get back into programming I would gladly toss the mega's in the garbage and move on.

My question to anyone here is: Which arduino is glitch free to program? Which arduino's actually program without all the error's coming up like time outs and the worse one that really screws me up is that the ports are all screwy. Arduino wants to use the same port as the mouse and there is no work around for that and hopefully that's just with the mega's.

any help will be much appreciated
thanks
jessey

See my response to Arduino Mega 2560 - sudden unknown USB device - IDE 1.x - Arduino Forum