Upload Timeout Error on Mega 2560 - Not Sure What Changed

I'll try to update the bootloader if it is not too complicated

Hi guys!
I had the same problem with a mega256
In my code i wrote a function to send via udp packet a string containing "!!!" and all stopped working.
Removing !!! from the string i fixed the problem!

Thanks for the rescue. I too have been having this problem after a small edit to the program and assumed it was related to the watchdog functions I was using. However, I had added a literal string printing to the serial post ending with !!!. Removal of the exclamation marks solved the problem.

It's a bit bizarre but I always thought that, aside from escape characters, the contents of a literal string were basically ignored.

Thnx again.

I think I have a completely bricked Mega...

Loopback passes...

DFU programmed just in case...

Cannot use Arduino as ISP using an UNO

Cannot use Nick Gammon board identified or programmer, error is "Cannot enter programming mode"...

Trying to use avrdude manually using the fuses in this thread as well as the bootloader from the Arduino install, nothing...

Time to throw it out?

c:\Program Files (x86)\Arduino\hardware\tools\avr\bin>avrdude -p atmega2560 -c stk500 -P com12 -e -Ulock:w:0xEF:m -Uefuse:w:0xFD:m -Uhfuse:w:0xd8:m -Ulfuse:w:0xff:m -U flash:w:stk500boot_v2_mega2560.hex -C ../etc/avrdude.conf

Guys!

It's been 5 years and this problem is still actual.
I'm zero in programming, so I use maxuino to do my projects!
Was just trying to upload the standard firmata on my arduino atmega 2560.
The usual mistake:
avrdude: stk500v2_ReceiveMessage(): timeout
keeps coming out.

I read the whole thread and tried to do anything I had a decent understanding about: like installing different firmware (0023 ecc).

But the mistake stays.

I see here really experienced people.
Is there anybody, that could help me on this one?

Thank you a lot!!

Alexander

I had the same problem, and searching I found that:

In one comment it says:

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: String with three exclamations - Programming Questions - Arduino Forum

So in my code were strings with "!!!". I deleted them and now the program uploads with no problems.

I am experiencing this with a UNO board.
Serial Comm is working fine to the UNO.
Upload to another MEGA board is fine so i assume its not my PC thats a problem.
But upload to the UNO board gives me this timeout problem.
Could it be possible that the boards programmer itself is faulty?

I noticed that some of you had a similar scenario that I experienced where it seemed like no posted solution online helped the problem. I managed to unbrick the mega 2560 by a few steps and two sources that I will provide credit to.

I followed Nick Gammon's guide to flashing both the ATmega 2560 and the 16u2 chips using an Uno through the arduino IDE. Follow his instructions here:

and the source codes are provided on his git page. His programmer can be saved into your sketchbooks

After flashing the 16u2, the USB will be unrecognizable. This is mentioned on Nick Gammon's section about the 16u2. As I was flashing off of Windows 8.1 I instead used Atmel Flip as my dfu programmer http://www.atmel.com/tools/FLIP.aspx.

The "L" led on the mega should be flashing if you're in dfu mode. Disconnect the wires to the Uno if it is. Next I recommend following this youtube video on how to use Flip with the 16u2.

When selecting the hex file to load locate the arduino folder on your C drive (for windows) then go to /hardware/arduino/avr/firmwares/atmegaxxu2/arduino-usbserial and select the Arduino-usbserial-atmega16u2-Mega2560-Rev3.hex file.

Before I did this I flashed the combined file and turns out the address was out of range.

Unplug and plug in the mega after and a new com port should appear in your device manager/IDE

hello guys...

i started my own arduino for my project..

after the assembly of entire board, i successfully uploaded the firmware to both atmega16u2 using atmel's FLIP software and atmega2560 as guide from gammon's forum Gammon Forum : Electronics : Microprocessors : Atmega bootloader programmer...

when i tried to upload blink code to my board it shows timout error...

Sketch uses 1,554 bytes (0%) of program storage space. Maximum is 253,952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8,183 bytes for local variables. Maximum is 8,192 bytes.
C:\Program Files\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega2560 -cwiring -PCOM16 -b115200 -D -Uflash:w:C:\DOCUME~1\Krishna\LOCALS~1\Temp\build08e4957f02c018eb579e11ddc64f9701.tmp/Blink.ino.hex:i

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Program Files\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM16
Using Programmer : wiring
Overriding Baud Rate : 115200
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

avrdude done. Thank you.

can anyone help me in solving this problem weather it is hardware or software side
........

firmware for atmega16u2 is "arduino_dfuserial.hex"

Hi,

Thanks yampilop

I remove !!! and WORKS :slight_smile:

Regards

Joao

I was having the same issue for a couple days on a custom PCB with an ATMEGA2560 chip on it. After trying many different things, re-installing the FTDI drivers fixed the problem for me.

I think that when I started using those cheap Chinese Arduinos, the ones with the CH430 USB to serial converter IC, the drivers for the CH430 conflicted with the drivers for the FTDI chip. Also, upgrading my OS could have caused the FTDI drivers to stop working as well, though I am not sure.

I hope this works for you guys!

In my case, the solution for "avrdude: stk500v2_ReceiveMessage(): timeout " error was to remove any connectors plugged in the digital pins 0 and 1 (I had an Arduino Mega 2560 shielded with RAMPS 1.4 and a servo connected to D1). These pins are reserved for Tx/Rx and having any device connected to them will mess the normal communication between PC and the board. I wish you good luck!

If your RX ,TX of arduino is connected to any circuit,,uplaoding will be failed,,cause it needs RX,TX pin for uploading programme,so First remove the RX,TX connection,uplaod the code ,then connect again to your as usual circuit

pkrakow:
I recently started prototyping a new system with a Mega 2560. This is my 4th arduino system, and my 1st one using a Mega.

I have a simple program that I have successfully loaded on the Mega (it toggles some digital pins and sends some serial messages). Something's changed, and now I can't upload new images to the board. When I try to upload, I get the following error messages:


Binary sketch size: 4560 bytes (of a 258048 byte maximum)
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
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x10
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x11
avrdude: stk500v2_disable(): failed to leave programming mode

I'm trying to track down the source of the problem. Here's what I know:

  1. The Green "on" light is on when the board is powered up.
  2. The "L" light flashes when I power up the board (indicating that the bootloader is present).
  3. The code that I loaded on the board still runs (I can see the digital pins toggling).
  4. I have the arduino IDE pointing to the correct COM port and setup for the Mega board
  5. I have tried two different PCs
  6. I have disconnected all of the external circuits that were attached to the Mega

Does anyone have any debug ideas? I have a scope, so I can capture an image of the serial lines during upload if that would help.

Hi,

I am also getting the same error but till now unable to fix it.I have arduino mega2560 board which is showing the same error as mentioned abobe.

I have tried the Resetting while compiling and tried to dump the arduino usb serial code also and tried even stk500boot_V2_mega2560.hex.

But it is showing in device manager for the Board detection but unable to dump the code.While dumping it is showing me the same error.

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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

If somebody please help regarding this it will be great as i have spend almost 1 week on this issue but still no success

Regards,
Vipin

vipinmishra:
Hi,

I am also getting the same error but till now unable to fix it.I have arduino mega2560 board which is showing the same error as mentioned abobe.

I have tried the Resetting while compiling and tried to dump the arduino usb serial code also and tried even stk500boot_V2_mega2560.hex.

But it is showing in device manager for the Board detection but unable to dump the code.While dumping it is showing me the same error.

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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

If somebody please help regarding this it will be great as i have spend almost 1 week on this issue but still no success

Regards,
Vipin

I just started working on this similiar problem today and am trying to figure it out. Looking through this thread would be a good place to start.

I'm experiencing the same issue with the timeout error for my Arduino Mega on a MacBook. And no it's not in the '!!!' because I don't have that. The Arduino Uno is still working but the Arduino Mega isn't. I'm looking for an answer for so long now! Please someone help :(!

I am getting the same error when i try to upload something to my Arduino mega 2560 rev3 + EMW3162 WiFi Shield. When i disconnect the shield it works fine ? Did someone heave solution for this ?

yampilop:
I had the same problem, and searching I found that:
arduino - avrdude: stk500v2_ReceiveMessage(): timeout - Stack Overflow

In one comment it says:
So in my code were strings with "!!!". I deleted them and now the program uploads with no problems.

The above was exactly the problem in my Sketch, changed it as outlined and it downloaded just fine.

Thanks for the help