I'm receiving the error: "avrdude: stk500_getsync(): not in sync: resp=0x30" when I try to upload sketches. I've searched the forums and found a post by someone else who had the same error, but none of the fixes seem to apply to my problem.
I just received my Arduino Uno starter kit for Christmas and was happily working along writing and rewriting sketches to experiment with my newest toy, when this hit all-of-the-sudden. The last sketch I uploaded was a simple digital write loop that makes the piezo speaker buzz. I had been playing with the Serial.write command for debugging, but was not using that command in my last sketch. I did leave the initialization statement "Serial.begin(9600);" in my sketch, but that could all be a red herring.
I've tried tricks with the reset button, unplugging/plugging in, shutting down all COM ports except the Arduino, rebooting the computer, uninstallling/reinstalling the IDE from my computer, disconnecting all Arduino pins, and messing with the COM port settings. Device manager and IDE both say my Arduino is on COM3.
Through all of my efforts, my last sketch is happily zipping along as if nothing was wrong. When I attempt to upload new sketches the TX/RX lights do not respond on the board. My old sketch just keeps running.
Was your sketch outputting data on D0 or D1? That can conflict with the bootloader starting.
Try this:
In the IDE, File:Preferences, check the Verbose outputs.
Press & hold the reset button, and download your sketch - when the IDE shows "compiled xxx of 32xxx bytes", release the reset button.
Might take a couple of tries to get the timing right.
If that works, don't have your sketch output on those 2 pins.
I inferred early on that it could be a bad idea to use digital pins 0 and 1 because they are labeled as TX and RX on the board, and have not used them as input or output in any of my experimental sketches so far. I have been using the verbose outputs since I resumed my troubleshooting efforts this morning. The complete output is listed at the bottom. I wish I had run a verbose a few times when it was working so that I'd have a better idea what it's trying to do. I have tried holding and releasing the reset button at various times during upload with no change in results, but I was working more randomly before. I'll try to hit it where you recommend a few times and see what happens.
--verbose bootload output--
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:\Program Files (x86)\Arduino\hardware/tools/avr/etc/avrdude.conf"
Using Port : \.\COM3
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv: 0 [30]
avrdude: stk500_getsync(): not in sync: resp=0x30
Just for fun, I connected a couple of LED's to pins 0 and 1, and it appears that both are pushing a digital output HIGH. They don't change when attempting to upload a sketch.
I've still had no luck trying to punch the reset button at just the right time.
Not sure if it provides any insight, but I've tried to recreate the code from my last successful upload from memory. It's posted below.
Notice there is a "Serial.begin" but no "Serial.write" also there is no delay and there is an integer (x) that counts infinitely without being reset. (My intent was to create a code that would buzz once and stop, but I forgot to deal with the integer limit. Would have fixed that on my next upload.)
Okay, I figured this out. ...at least I did fix it. The problem turned out to be in my computer and not in the Arduino. Rebooting and uninstalling/reinstalling the drivers wasn't enough, but as I continued to mess with settings and change the COM port numbers over and over eventually it started to work!