Go Down

Topic: Upload Timeout Error on Mega 2560 - Not Sure What Changed (Read 65565 times) previous topic - next topic

chuatc

I was having the same issue.

But end up I realized that I have place the reset switch A_RST_M at the wrong position.
Correcting the switch position and my Arduino is now working well.

DROBNJAK

I just joined in to say that I have this same problem. This ruined at least three weekends for me. Instead of working on new projects, I am banging my head into the wall, trying everything to resolve this.

I have Mega 2560, R2l, on Win XP SP3. It constantly either hangs with timeout, or sometimes it tells me that COM port is taken by another application. I always either get timeout or port locked by other applicaiton.

So many Mega 2560 owners are having problems with this, that developers should definitely check this one out.

xvjeko

#32
Jun 15, 2012, 06:09 pm Last Edit: Jun 15, 2012, 08:58 pm by xvjeko Reason: 1

I just joined in to say that I have this same problem. This ruined at least three weekends for me. Instead of working on new projects, I am banging my head into the wall, trying everything to resolve this.

I have Mega 2560, R2l, on Win XP SP3. It constantly either hangs with timeout, or sometimes it tells me that COM port is taken by another application. I always either get timeout or port locked by other applicaiton.

So many Mega 2560 owners are having problems with this, that developers should definitely check this one out.


I tottaly agree. But I can't expect support because my sparkfun mega isn't "official"...

mellis

For those of you having trouble, can you try changing "stk500v2" to "wiring" for the Mega 2560 in your boards.txt file (in the hardware/arduino sub-directory of your Arduino application directory)?  That should tell avrdude to do an auto-reset of the board before the upload (in addition to the one done by the IDE itself), which might help.

See: http://code.google.com/p/arduino/issues/detail?id=806 for more information and updates.

#34
Jun 17, 2012, 06:13 pm Last Edit: Jun 17, 2012, 07:25 pm by Josephiah Reason: 1
Just wanted to add my voice to the chorus on this issue.  I'm using a Mega 2560 R2 with Arduino 1.0.1 running on Mac OSX 10.6.8.  Changing "stk500v2" to "wiring" has made no discernible difference.

As a few users on this thread and others have found, it has been a sudden behaviour change where I can't think of anything I've changed...

EDIT:  to add a couple more details:

  • The sketch that is currently loaded still functions perfectly.

  • (non-)behaviour is seemingly identical in Arduino IDE 0022, 0023, and 1.01.


xvjeko


Just wanted to add my voice to the chorus on this issue.  I'm using a Mega 2560 R2 with Arduino 1.0.1 running on Mac OSX 10.6.8.  Changing "stk500v2" to "wiring" has made no discernible difference.

As a few users on this thread and others have found, it has been a sudden behaviour change where I can't think of anything I've changed...

+1

mellis

It sounds like there may be different things going on here, since some of you are seeing different symptoms / behaviors. 

Josephiah and DROBNJAK, can you post the verbose output of an upload attempt?  Have you tried a different USB cable?  Are you going through a USB hub (if so, try connecting the board straight to the computer)?

xvjeko

if it helps, it doesn't work for me neither.
Tried 2 pc-s and 2 cables. It all worked before (sometimes i didnt saw progress bar so i had to reconnect mega and it worked)
but now i am stuck at 95% progress bar, and smtimes my L is on for the whole time, and sometimes not... cheers


Josephiah and DROBNJAK, can you post the verbose output of an upload attempt?  Have you tried a different USB cable?  Are you going through a USB hub (if so, try connecting the board straight to the computer)?


Hi Mellis, thanks for your help.  Changing USB cable doesn't seem to make a difference, and it's plugged into the same USB port on my mac as it always has been.  The results also appear to be the same whether I have the mega on its own with nothing else plugged in, or with a shield attached (I'm currently using it for a monome-like project).

Sometimes I get this:

Code: [Select]
Binary sketch size: 1,624 bytes (of a 258,048 byte maximum)
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega2560 -cwiring -P/dev/tty.usbmodem-chr-001 -b115200 -D -Uflash:w:/var/folders/Vd/VdFeGvFZG4Gc-qfuGxx6pE+++TI/-Tmp-/build893675159181048838.tmp/Blink.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
        User configuration file is "/Users/Jo/.avrduderc"
        User configuration file does not exist or is not a regular file, skipping

        Using Port                    : /dev/tty.usbmodem-chr-001
        Using Programmer              : wiring
        Overriding Baud Rate          : 115200
avrdude: wiring_open(): releasing DTR/RTS
avrdude: wiring_open(): asserting DTR/RTS
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv: . [1b]
avrdude: Recv: . [0e]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv: . [1b]
avrdude: Recv: . [0e]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv: . [1b]
avrdude: Recv: . [01]
avrdude: Recv: . [00]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [02] . [00] . [01] . [0e] . [01] . [17]
avrdude: Recv: . [1b]
avrdude: Recv: . [0e]
avrdude: Recv: . [01]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [02] . [00] . [01] . [0e] . [01] . [17]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [02] . [00] . [01] . [0e] . [01] . [17]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude done.  Thank you.


And sometimes this:

Code: [Select]
Binary sketch size: 1,624 bytes (of a 258,048 byte maximum)
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega2560 -cwiring -P/dev/tty.usbmodem-chr-001 -b115200 -D -Uflash:w:/var/folders/Vd/VdFeGvFZG4Gc-qfuGxx6pE+++TI/-Tmp-/build893675159181048838.tmp/Blink.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
        User configuration file is "/Users/Jo/.avrduderc"
        User configuration file does not exist or is not a regular file, skipping

        Using Port                    : /dev/tty.usbmodem-chr-001
        Using Programmer              : wiring
        Overriding Baud Rate          : 115200
avrdude: wiring_open(): releasing DTR/RTS
avrdude: wiring_open(): asserting DTR/RTS
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv: . [1b]
avrdude: Recv: . [01]
avrdude: Recv: . [00]
avrdude: Recv: . [0b]
avrdude: Recv: . [0e]
avrdude: Recv: . [01]
avrdude: Recv: . [00]
avrdude: Recv: . [08]
avrdude: Recv: A [41]
avrdude: Recv: V [56]
avrdude: Recv: R [52]
avrdude: Recv: I [49]
avrdude: Recv: S [53]
avrdude: Recv: P [50]
avrdude: Recv: _ [5f]
avrdude: Recv: 2 [32]
avrdude: Recv: t [74]
avrdude: stk500v2_getsync(): found AVRISP programmer
        AVR Part                      : ATMEGA2560
        Chip Erase delay              : 9000 us
        PAGEL                         : PD7
        BS2                           : PA0
        RESET disposition             : dedicated
        RETRY pulse                   : SCK
        serial program mode           : yes
        parallel program mode         : yes
        Timeout                       : 200
        StabDelay                     : 100
        CmdexeDelay                   : 25
        SyncLoops                     : 32
        ByteDelay                     : 0
        PollIndex                     : 3
        PollValue                     : 0x53
        Memory Detail                 :

                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                 Block Poll               Page                       Polled
          Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
          ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
          signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

        Programmer Type : Wiring
        Description     : Wiring
        Programmer Model: AVRISP
avrdude: Send: . [1b] . [02] . [00] . [02] . [0e] . [03] . [90] . [86]
avrdude: Recv: . [1b]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [02] . [00] . [01] . [0e] . [01] . [17]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [02] . [00] . [01] . [0e] . [01] . [17]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [02] . [00] . [01] . [0e] . [01] . [17]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [02] . [00] . [01] . [0e] . [01] . [17]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [02] . [00] . [01] . [0e] . [01] . [17]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [02] . [00] . [01] . [0e] . [01] . [17]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: Send: . [1b] . [02] . [00] . [02] . [0e] . [03] . [90] . [86]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [02] . [00] . [01] . [0e] . [01] . [17]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [02] . [00] . [01] . [0e] . [01] . [17]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [02] . [00] . [01] . [0e] . [01] . [17]
avrdude: ser_recv(): read error: Device not configured


(that last line from me unplugging the board.)

Cheers,
Jo

dieselboris


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.


I did put a string containing "!!!!!!!!" in my code. Deleted it but no luck, same timeout error. Uploaded the Blink example (think this resetted the memory or something) and uploaded my original code again and it works again.

weird? or not?

I am having the same problem when trying to upload my program. Every time I try to upload it says 'time out' or 'time out communicating with programmer'. I have been reading through all the advices you guys gave, but I'm not that experienced with adjusting the code of the Arduino software, so I have no idea what to do.

aleffe

I have to report my findings with Arduino Mega 2560. I struggled hours with these
"avrdude: stk500v2_ReceiveMessage(): timeout", "avrdude: ser_recv(): read error: Device not configured"
error messages that started haunt me just when I was adding some new data to my program.

First I though that I had too much data (although I had only 18Kb). Removing the new data solved the issue. Then I started to look deeper in to the issue. Finally I managed to track this down to very weird root cause:

When ever a sequence of "0x21, 0x21, 0x21" is added to PROGMEM and this variable is referenced like:
const unsigned char bug[3] PROGMEM = {0x21,0x21,0x21};
pgm_read_byte(&bug[0]);
Uploading fails!!

If I change one of those 0x21s to something else, everything works like a charm again. This has to be some sequence that causes Arduino somehow to get stuck... Just unbelievable but true.

My setup is:
Arduino 1.0.1
Arduino Mega 2560 (ok it is from DE...)
AVRISP mkII (same happens with AVR ISP)
Mac OS 10.6.8

So if you have weird upload problems, just check your code for this sequence...

I am using Mac OS 10.6.8 too, but where can I change the program of the arduino software? On my windows pc I can find the boards.txt file, but in my mac I can't find it and I don't know how to change it.

Louis Davis

aleffe,
This is a known issue and is being addressed in a future 2560 bootloader. See here for details:
http://code.google.com/p/arduino/issues/detail?id=392

Go Up