Arduino Forum

Using Arduino => Installation & Troubleshooting => Topic started by: Dante12129 on Jan 02, 2012, 09:10 am

Title: Sketches Not Uploading To Mega
Post by: Dante12129 on Jan 02, 2012, 09:10 am
I bought a Mega 2560 R3 from Radioshack a few days ago. I tried it on one computer, and it woldn't upload any sketches. On my second computer, it was able to upload Blink but when I tried the AnalogReadSerial, DigitalReadSerial, and BareMinimum, it wouldn't work. I did the loopback test and that worked fine. I am using XP. Here is my error code:

Binary sketch size: 678 bytes (of a 258048 byte maximum)
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: 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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x10
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x11
avrdude: stk500v2_disable(): failed to leave programming mode
Title: Re: Sketches Not Uploading To Mega
Post by: Thyvo on Jan 02, 2012, 05:15 pm
I'm having a the same problem
Title: Re: Sketches Not Uploading To Mega
Post by: Mozart on Jan 03, 2012, 01:31 am
I am able to get sketches uploaded, however, I am unable to use avrdude to upload anything to the ATmega 2560.  It seems like a lot of people are having this same issue, however, there does not appear to be a consistent solution.
Title: Re: Sketches Not Uploading To Mega
Post by: Dante12129 on Jan 04, 2012, 01:15 am
Would it be safe to try using the "Upload Using Programmer" option? What is the difference?
Title: Re: Sketches Not Uploading To Mega
Post by: ajofscott on Jan 04, 2012, 01:57 am
If the Mega is installed in windows correctly it posts as a com port in the device manager under ports com/lpt. Windows 7 users will have to download the divers from arduino.cc and then manually browse the arduino-1.0\drivers directory from the device manager update driver utility. The unistalled mega will be listed as an unknown device on USBxx where xx is the hub's logical port.
Title: Re: Sketches Not Uploading To Mega
Post by: Mozart on Jan 04, 2012, 02:16 am
I am currently running Windows XP.  The com port does show up in
<Control Panel>-><System>-><Hardware>-><Device Manager>-><Ports (Com & Lpt)>-><Arduino Mega 2560 R3 (Com4)>

I have tried all of the Reset advice provided in the documented solution (i.e. hold the button down and run run avrdude) but still the best I can get is the Timeout() error.  Is there some other piece of information that I can provide to assist in debugging this?
Title: Re: Sketches Not Uploading To Mega
Post by: Mozart on Jan 04, 2012, 02:30 am
I thought this might help, let me know if anyone needs more:

avrdude -F -v -pm2560 -cstk500v2 -P\\.\COM4 -b19200 -D -Uflash:w:"C:\Documents and Settings\Mozart\My Documents\Arduino Test Project\MEGA_GPIO_EXAMPLE1\MEGA_GPIO_EXAMPLE1\Debug\MEGA_GPIO_EXAMPLE1.hex":i

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

         System wide configuration file is "C:\Arduino\arduino-1.0\hardware\tool
s\avr\bin\avrdude.conf"

         Using Port                    : \\.\COM4
         Using Programmer              : stk500v2
         Overriding Baud Rate          : 19200
avrdude: stk500v2_ReceiveMessage(): timeout
Title: Re: Sketches Not Uploading To Mega
Post by: Dante12129 on Jan 04, 2012, 03:49 am
Hpw did you get that? And can we try to fix my problem?
Title: Re: Sketches Not Uploading To Mega
Post by: Dante12129 on Jan 04, 2012, 11:07 pm
I'm going to get a replacement but it wouls still have been nice to be able to fix it.
Title: Re: Sketches Not Uploading To Mega
Post by: Mozart on Jan 05, 2012, 04:02 am
Sorry Dante, didn't mean to hijack the thread.  I thought you were experiencing the same issue as I was.  I will open a new thread.  I hope you figure this thing out...I hope I figure mine out too.
Title: Re: Sketches Not Uploading To Mega
Post by: ajofscott on Jan 06, 2012, 01:10 am
The serial monitor ties up the com port just as an upload would, make sure no serial monitors are open, go to com4's properties and click advanced, set a port spec above com10. Select the applicable port in the ports menu in the arduino ide  tools....Serial Ports
Title: Re: Sketches Not Uploading To Mega
Post by: Dante12129 on Jan 06, 2012, 02:17 am
My new board is working fine now.
Title: Re: Sketches Not Uploading To Mega
Post by: Dante12129 on Jan 07, 2012, 02:23 am
Well I was able tp upload fine to it yesterday and now this one isn't working either. The last program I uploaded was the one for a PING, and it will still send the measurements from it back over serial. I've tried changing the COM number and that won't work. When I uploades ysterday, the TX/RX both blinked very rapidly but now they both blink every seconds. It's the same error as last time.

Edit: Now the onboard LED and TX are both permanetly on.
Title: Re: Sketches Not Uploading To Mega
Post by: ajofscott on Jan 07, 2012, 04:10 am
what external devices are connected to this board?
Title: Re: Sketches Not Uploading To Mega
Post by: Dante12129 on Jan 07, 2012, 06:09 am
I've tried it with both ping hooked up and with nothing hooked up.
Title: Re: Sketches Not Uploading To Mega
Post by: Dante12129 on Jan 07, 2012, 11:50 pm
Well apparently i was mislead into thinking that Arduino had a great community to get help from.
Title: Re: Sketches Not Uploading To Mega
Post by: smeezekitty on Jan 08, 2012, 04:41 am

Well apparently i was mislead into thinking that Arduino had a great community to get help from.

First of all, lose the attitude.
Did it ever work? If so what were you doing when it stopped working?
Title: Re: Sketches Not Uploading To Mega
Post by: Dante12129 on Jan 08, 2012, 04:50 am
It was runninthe example for the PING sensor.
Title: Re: Sketches Not Uploading To Mega
Post by: smeezekitty on Jan 08, 2012, 05:34 am

It was runninthe example for the PING sensor.

What was connected and how?
Please try the loop back test that is stickyed to the top of this board.
Title: Re: Sketches Not Uploading To Mega
Post by: Dante12129 on Jan 08, 2012, 06:05 am
It was connected like in the tutorial. The loopback test works fine and everything is echoed.

EDIT: Also, the LED stays solid whenever I have it powered on.
Title: Re: Sketches Not Uploading To Mega
Post by: smeezekitty on Jan 08, 2012, 07:44 am
Does pressing reset cause the lights to flash?
Is the MCU warm at all?
Title: Re: Sketches Not Uploading To Mega
Post by: Dante12129 on Jan 08, 2012, 07:48 am
Pressing the reset button makes the led go off for a second and come back on. The MCU feels normal temperature.
Title: Re: Sketches Not Uploading To Mega
Post by: smeezekitty on Jan 08, 2012, 08:12 am
Play with the manual reset timings alittle. Sometimes it will eventually upload and then work like normal.
But at this point I am out of ideas.
Title: Re: Sketches Not Uploading To Mega
Post by: ahmadzein on Jan 18, 2012, 08:01 pm
:'( ANYYY SOLUTION PLEASEEEE  :( :( :( :( :( :( :( :( :( HELPPP

am having this too with mega2650  on mac osx lion when trying any script

the RX led stay blinking every couple of seconds while timeouting !!  any idea !?!?!?

when i bought the mega 2650 i've installed the ATmega16U2 firmwork on it using dfu-programmer 0.5.4

it's displayed in the system report as :

Communication Device:

  Product ID:   0x0042
  Vendor ID:   0x2341
  Version:   0.01
  Serial Number:   
  Speed:   Up to 12 Mb/sec
  Manufacturer:   Arduino (www.arduino.cc)
  Location ID:   0xfd130000 / 5
  Current Available (mA):   500
  Current Required (mA):   100



Binary sketch size: 1602 bytes (of a 258048 byte maximum)
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: 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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x10
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
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_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
Title: Re: Sketches Not Uploading To Mega
Post by: aefields on Jan 18, 2012, 10:12 pm
I went back to Arduino version 0022 and that solved the problem for me.  If you're using 1.0, try 0022 or 0023 and see if that works.
Title: Re: Sketches Not Uploading To Mega
Post by: ahmadzein on Jan 18, 2012, 11:54 pm
am using 1.0 yeah, i tried 0022 still didn't work and give the save error thing:

same with the L led blink once when pressing upload:

Binary sketch size: 1584 bytes (of a 126976 byte maximum)
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding


and this is with shift knowing that the RX blink every couple of sec and the L led blinks once too it is not doing so in 1.0:

Binary sketch size: 1588 bytes (of a 258048 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 -cstk500v2 -P/dev/cu.usbmodemfa141 -b115200 -D -Uflash:w:/var/folders/tw/pvysvp5j30nfl10nlwfxkjn40000gn/T/build5699690773042818558.tmp/Blink.cpp.hex:i

avrdude: Version 5.4-arduino, compiled on Oct  9 2007 at 11:20:31
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

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

         Using Port            : /dev/cu.usbmodemfa141
         Using Programmer      : stk500v2
         Overriding Baud Rate  : 115200
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]


am downloading 0023 now to try it...  :smiley-sad-blue:
Title: Re: Sketches Not Uploading To Mega
Post by: ahmadzein on Jan 19, 2012, 12:27 am
nothing worked not even 0023....
Title: Re: Sketches Not Uploading To Mega
Post by: albertosaez on Feb 26, 2012, 11:39 pm
Be sure your code hasn't any string with "!!!" inside

This is not a joke:
  http://code.google.com/p/arduino/issues/detail?id=797