Pages: [1]   Go Down
Author Topic: upload issues with mega 2650, bootloader is timing out...  (Read 1734 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

Everyone,
  By looking at the source to avrdude, I was able to fix my upload issue. I made it do the reset like what is done in arduino.c.   This fixed all my upload issues.  My theory is that the reset is done by the gui, then it loads avrdude.  But, if too much time elapses, the bootloader has moved on.     I also reset the serial timeout, and retries to the values from 5.4-arduino.     Between these changes, my upload is now much more solid.

Here is my patch on 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);


JesseJay
« Last Edit: January 19, 2012, 10:53:58 pm by jessejay356 » Logged

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

Thought I'd bump this.   The above patch to AVRDUDE 5.11.1 fixed all my upload issues on my mega2650.    Anyone else willing to try it out?    What does it take to submit a real bug report?
Logged

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

I rebuilt avrdude with the above patch and can report that it didn't fix the issue for me. I'm using a Mac, OSX 10.6.8.
Logged

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

I'm also having problems with my board timing out. Would it be possible for you to walk me through how you went about doing this?

Thanks a lot,
Logged

Pages: [1]   Go Up
Jump to: