Pages: 1 [2] 3 4 ... 6   Go Down
Author Topic: Upload Timeout Error on Mega 2560 - Not Sure What Changed  (Read 55108 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A lot of people seem to be having problems with the new version, including me.  *sigh*  Hopefully they figure it out..
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.   
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I believe I have found a fix.  But I had to compile an new avrdude.exe.  Here is a patch for avrdude-5.11.1/stk500v2.c

73c73
< #define SERIAL_TIMEOUT 2
---
> #define SERIAL_TIMEOUT 5
76c76
< #define RETRIES 5
---
> #define RETRIES 33
1317a1318,1325
>
>   printf("trying this reset stuff now..\n");
>   usleep(50*1000);
>
>   serial_set_dtr_rts(&pgm->fd, 1);
>   usleep(50*1000);
>   serial_set_dtr_rts(&pgm->fd, 0);
>   usleep(50*1000);

« Last Edit: January 19, 2012, 10:54:36 pm by jessejay356 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

where did you find this file ?? do i just add these?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

AVRDUDE 5.11.1 can be found at http://download.savannah.gnu.org/releases/avrdude/

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.

JesseJay
Logged

New Jersey
Offline Offline
God Member
*****
Karma: 2
Posts: 525
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Peckham London
Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Moi aussi. But I can upload with Parallels PC emulator running Windows XP on my MAC but not my actual MAC.


Logged

Smooberry Dooberry.

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Here's a sample sketch to reproduce the error:
Code:
void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Serial.println("!!!");
}


Hopefully this will help.
« Last Edit: April 12, 2012, 06:41:59 am by deajan » Logged

Denmark
Offline Offline
Sr. Member
****
Karma: 10
Posts: 287
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

#deajan
Thanks, that solved the problem for me.
I'm running Mac OS X 10.7.3, Arduino IDE 1.0 & Arduino Mega ADK r1.
Logged

Sweden
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Better Guitar-sound through Hi-Tech
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks to Michael635 for showing that replacing the AVR directory from rev-0023 solves the problem. It solved mine!
Anders
Logged

Monterrey, N.L. México
Offline Offline
Full Member
***
Karma: 1
Posts: 154
Model Railroading & Arduino are Fun
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@aefields

Quote
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!"
Very true! smiley-wink

I had the same problem and just fixed it by doing that exactly. Now, it works fine. Thank you! smiley-cool

I also renamed all of my sketches from *.ino to *.pde.
Logged

Billy     http://www.z-world.com/operations/gbremer/

When you've eliminated the impossible,
whatever remains, however improbable, must be

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

would anybody care to speculate why I am unable to upload a sketch which produces an object of approximately 36k when I can upload an object of 34k? I have been working with windows XP and arduino 1.0 for several weeks now and today my the object grew to just over 36k. Now I cannot upload it. I can upload the program when I'm using Linux with arduino-1.0 (downloaded from the git repository over 2 months ago) but none of the windows boxes will upload it. We are using Windows XP and Windows 2003 server with no luck... HELP!? please.
Thanks
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8849
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It would really help if you said what the error was rather than the vague phrase "unable to upload".

Did you add a string that contains three or more '!' in a row?
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sorry for not being more explicit. The upload just hangs, no error messages, no output, it just never finishes. If I use my Debian Linux machine, it works fine. If I reduce the size of the sketch, it works fine. But my sketch of 36742 bytes wont upload. As I watch the lights on the Mega, it looks curiously as if the Mega is being reset right in the middle of the upload.
THANKS FOR ANY HELP!
Fred
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there a solution to these sketch upload timeout errors yet?
My older Mega works fine, as do all my other FTDI based 'duinos, but the Mega R3 is useless to me right now. Meh!
Arduino 1.0 on MacOS 10.6.8
Maybe dumb question: is the Mega R3 programmable with a FTDI USB cable?
John
Logged

Pages: 1 [2] 3 4 ... 6   Go Up
Jump to: