Mega2560 Timeout Communication Problem

Hello everyone,

I have designed an arduino mega2560 myself and assembled it. Firstly, I have uploaded Arduino-usbserial-atmega16u2-Mega2560-Rev3 hex file to atmel 16u2 chip using FLIP program without any error. And then I have burned bootloader to 2560 chip using ICSP pins and a master arduino uno without any error. Now my board is ready to upload any sketch,yet the problem begins at this point. I am trying to upload a basic "led on" sketch, but after 5 trials, it fails showing timeout error. Indeed for each try to send I can only see RX led is on shortly. I tried reburn the bootloader and upload hex file to 16u2 again and again, yet I could not find the solution. I have read lots of topic related to this, but none of them is solved mine.

Sketch uses 1556 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
"C:\Users\hobbit\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\hobbit\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega2560 -cwiring "-PCOM4" -b115200 -D "-Uflash:w:C:\Users\hobbit\AppData\Local\Temp\arduino\sketches\930136B7174FBB4FB9999C7EFA915B51/deneme.ino.hex:i"

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\hobbit\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

         Using Port                    : COM4
         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.

Failed uploading: uploading error: exit status 1
1 Like

what bootloader did you burn?

It is under arduino ide/tools, the last selection

Any suggestion to this topic?

1 Like

hello. Did you ever solve it?

I often wake up like this too.
There is no problem with driving so far, but I am a little uneasy.

No, I still have the problem. Indeed I can upload bootloader via Arduino IDE without any problem, yet when I tried to upload a simple sketch through atmega 16u2, it fails. Some people suggest to remove 1k resistor which is connected to between DTR and GND. However I am not sure to remove the solder, since it is exactly same schematic given in arduino website. https://content.arduino.cc/assets/MEGA2560_Rev3e_sch.pdf

I had the same problem or I was in the same situation as well.

I bootloaded my ATmega, then I uploaded just once a simple blink test (it was runing) and after that, believe me, was nothing else possible. The ATmega was like locked. No bootload and also sketch-upload was possible anymore. I changed nothing at the hardware. A uploaded with a new sketch, wasn´t just possible. I got immideatly the error message.

After many different test, now my Atmega works. Maybe it were the following adjustments.

You will find in the "bootloader"-folder the subfolder "stk500v2". An there the following bootloader .hex-file
-> stk500boot_v2_mega2560.hex <-

I replaced this file, with a light modificated file. It was specialy for my ATmega, that runs with Bautrate of 115200 and 16000000Hz (16MHz)

stk500boot_v2_atmega2560_115200_16000000L.hex

I can recommend to name it, like the file before and safely to store the original file (maybe in a subfolder). In case something went wrong, you can reverse it.
For implamanting the hex.-file I need to instal a suitable program, because in my case it was not possible to download the file from GitHub-homepage as ".hex". I changed it from ".txt"-file to ".hex".
You will find many suitable files there.

When someone get the error message meanwhile working on an sketch, I can also recommend to re-bootload the ATmega.

I know, this here is not THE SOLUTION for this error message, because every case is a little bit different. I just want to tell you, what me helped.

if someone have questions or did not understand something, just ask me and I will try to help. But for the first, Good luck

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.