I figured out what's causing the problem. The TX signal isn't making it to the ATMEGA8U2-MU that translates serial to USB. The TX pin on the ATMEGA2560-16AU is working, and signals from that pin make it all the way to the ATMEGA2560-16AU side of the RN4A resistor next to the ATMEGA8U2-MU, but the signal doesn't make it to the ATMEGA8U2-MU side of the resistor. It looks like the ATMEGA8U2-MU is messing up the signal.
I'm having the exact same problem. I wrote and updated code for a day, then moved the arduino to another computer, and I get the same errors. The original code still executes, I just can't upload new code to the board. Is there a way to reinstall the firmware?
I down loaded arduino-0023, made no changes to the port or hardware or preferences file and it works perfectly.
So, I renamed the avr directory in ...\arduino-1.0\hardware\tools and then copied the avr directory from ...\arduino-0023\hardware\tools directory into the ...\arduino-1.0\hardware\tools directory, and it works fine.
Conclusion, the issue is with the new version of avrdude.
Anyone have a verified and working fix? I've had my Arduino for about 4 hours and just got hit with this (and I'm not using any !!! in my code, which was allegedly the cause of the issue). This has been going on for months now and I gotta be honest - I'm pretty frustrated that the (presumably bootloader) issue still seems to be unfixed.
Thanks for the help. I have been struggling with this same problem and it seems many have as well. I downloaded the arduino 0023 software and I got the same results as you, so I copied and renamed as you suggested and the problem is fixed. So far so good.
I was having this problem too. Luckily I hadn't erased my old 0022 program. Going back to that fixed the problem. I really ought to remember: "Never update a program that works!"
Guys. I used the avrdude.exe and avrdude.conf file from 022 and it worked fine for me. There seems to be a bug in avrdude 5.11 that is causing some of these issues.
I provided a patch that can be applied to the file I mentioned. But you need to apply the patch and recompile avrdude for it to work. But my upload success rate went from 40% to 100%. The code now matches more closely the way the old version worked. It's a pain. The arduino people should recognize there is a problem, and fix it.
I have the same problem. I have a new Mega R3. I tried both Arduino 0022 and 1.0 on my Mac OSX 10.6.8. Sometime my sketch will upload fine, but most of the time it times out. Doing some Google searches, I found this seems to be a known problem, but I'm not sure how to fix it. I've seen some talk about avrdude, but I don't know anything about fixing, compiling and uploading a boot loader. Since this problem seems to be kind of old and my hardware and software are new, I'm surprised this problem still exists. What should I do?
Having tested alot with this problem, i found this:
Whenever i have string in my sketch which has threee marksigns in a string (eg: "!!!"), my sketch will make the Mega2560 timeout when uploading ("huh?..bootloader>" hex code message followed after multiple retries by avrdude: stk500v2_ReceiveMessage(): timeout ).
Using Windows 2008 R2 Server (think Win7 64 will do the same), Arduino IDE 1.0 & Arduino Mega2560 compatible.