Will upgrade to optiboot solve the stk500_getsync(): not in sync problem?

I've been editing, expanding and testing a sketch for 3 months. Suddenly I'm getting basically the same message. The avrdude.conf file is huge and I did not find any messages like his. I getting the error in the message area below the sketch. It comes when I to download the latest edited sketch, or any sketch. It is:

avrdude: stk500_getsync(): not in sync: resp=0x00
stk500_disable: protocol error, expect=0x14, resp=0x51

I cannot understand why this should suddenly come up. Have I damaged the board? Could an error in the sketch cause this? I tried an example sketch with the same result. I wrote a real simple sketch that reads a switch and lights a led, same message. The sketch is:

int switchPin = 8;
int lampPin = 12;
// switch connected to digital pin 13
int val = 0;
void setup()
{
pinMode(switchPin, INPUT); // sets the switch pin as input
pinMode(lampPin, OUTPUT); // sets the lamp pin as output
;
Serial.begin(9600);

}

void loop()
{
val = digitalRead(switchPin);
if (val == HIGH)
{
Serial.write("switch is HIGH ");
digitalWrite(lampPin, val);
}
else
{
Serial.write("switch is LOW ");
digitalWrite(lampPin, val);
}
}
I tried every baud rate setting in serial monitor but none cured my problem. Curiously the serial monitor still is printing the messages from the last iteration of my sketch when I open it at 9600 baud.

Jim

Hello jim,

To have a same message ,you must open the file preference.txt
and add at the end the two-line:
-build.verbose=true
-upload.verbose=true

ps:excuse me for my English

avrdude: stk500_getsync(): not in sync: resp=0x00
stk500_disable: protocol error, expect=0x14, resp=0x51

I cannot understand why this should suddenly come up. Have I damaged the board? Could an error in the sketch cause this? I tried an example sketch with the same result.

The error simply means that AVRDUDE (the program used to upload sketches) cannot communitcate with the bootloader program on the arduino. Causes can be many things, both hardware or software/firmware caused.

Normal next best step is to perform a serial 'loop back' test, that will test out the communications on the PC and the USB serial converter chip on the arduino board. I can't seen to find the 'sticky' thread on how to perform that test, maybe someone else can locate it for you?

Lefty

I ran loop back, it works OK. I removed the jumpers, same problem. I looked in windows hardware manager, it says com 10 is working.I unplugged the board, com 10 disappeared from the hardware manager. Re-connecting the Arduino made com 10 re-appear. The com port is set to com 10 as shown on the Title block of the serial monitor. I've tried 2 USB cables. The TX and RX LEDs flash like something is being communicated when you click download, however there is no boink from the computer when you connect. I plugged my USB mouse in to this USB connector and it worked fine, although no boink there either. Still no joy in Mudville.

I working on a Athalon 64 system, running XP PRO, using the USB port on the front panel of the computer.

This same issue is also being discussed in thread "avrdude: stk500_recv(): programmer is not responding",topic 66261.0. Should the 2 threads be combined?

In my previous post I failed to mention another curious behavior. with one Arduino plugged in, the com port is com 6. If you unplug the USB cable, then plug in the other Arduino, same USB port on the XP box and same cable, you have to change the port to com 10 to communicate with the Arduino. Swiching back to the first Arduino, you have to go back to com 6. Does the Arduino store the port number somewhere?

Jim

I tried deleting the com ports in the hardware manager and letting them reload. I also tried upgrading from 022 to 1.0 beta. No help! I searched online and found two topics in the old forum on this same problem. They are 1187909552 and 1209178536. Supposedly Da_Hero has a fix that works in Reply 112 1209178536, but I am unable to do this as I am handicapped and don't move fast enough. This appears to be an endemic Arduino problem, probably some avrdude/arduino bug. I also have a Mega, but I'm not going to plug it in until I have the solution in hand. Till then the Arduino's are nothing but an interesting sculpture! I'll keep watching tthese two topics and hoping there is someone out there who

Jim

I'm suddenly getting the message:
avrdude: stk500_getsync(): not in sync: resp=0x00
stk500_disable: protocol error, expect=0x14, resp=0x51
I've tried all kinds of tests suggested by others but have had no luck. According to some sites I've visited, it appears that you can reburn the bootloader. I have a project that is real important (to me), and I need to finish it, so I'll try almost anything. The only other thing I can think of is to replace the processor.

Jim

Have you performed a 'loop-back' test, to see if your comm path is functional?

Lefty

I tried loopback and it works as it should! i verified I was on proper com port. It was the correct driver, I deleted it and it re-installed the next time plugged in the Arduino, it still did not work.

Yes, I started a new topic, I did not start topic "serial flood" and first post is not mine in that topic but the rest are mine. I did not know it existed till I clicked on the link in "coding badly"'s post.

Jim

The problem is very likely that your sketch is flooding the serial port with data. That seems to interfere with the auto-reset.

• Connect the board to the computer

• Start the Arduino IDE

• Load or create an empty sketch...

void setup( void ) { }
void loop( void ) { }

• Ensure the correct board and serial port are selected

• Click Upload or press Ctrl+U

• Immediately hold the reset button on the board

• When the phrase "Binary sketch size: # bytes (of a 32256 byte maximum)" appears in the bottom black window, release the reset button

• Wait for the upload to finish

This does not cure my problem. I am still wondering if the problem is the bootloader.

Jim

Here is a presis of my problem
Unit consistently fails upload
pin 13 does blink
board duemilanove
Windows XP SP2
shut down for night when it was working, next morning not working. I closed down IDE by clicking the red X, top right corner.
error message:
avrdude: Recv:
avrdude: stk500_getsync(): not in sync: resp=0x1e
avrdude: Send: Q [51] [20]
avrdude: Recv:
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x1e

avrdude done. Thank you.
any other information needed, just ask

Jim

Other than the USB cable, what is connected to the board?

Is there a USB HUB in the middle?

I have tried 2 different cables. Originally there was a hub, but I moved the USB cable to the USB port on the front of the computer. This did not cure problem. I have since swapped the printer and the Arduino, making it a third cable, the printer did not care, it worked fine either way. I'm willing to buy a USBtinyISP and replace the bootloader, but I not sure that is the answer. I really need to get my project back on board, it is on a Mega but I'm afraid to plug it in right now!

Jim

Other than the USB cable, what is connected to the board?

I have nothing connected but the USB to the computer.

Jim

Has anything ever been connected to pin 0 or pin 1?

No, I specifically avoid those pins, actually pins 1-3, to avoid conflicts. I never connected them, I usually work down from pin 12. I've only user these Arduinos to test and verify the functionality of various bricks before using them in my main project.

Jim

The good news is there is no evidence the hardware is damaged.

One more test...

• Connect the board to the computer

• Start the Arduino IDE

• Load or create an empty sketch...

void setup( void ) { }
void loop( void ) { }

• Ensure the correct board and serial port are selected

While holding the Shift key, click Upload

• Wait for the upload to finish

• Select and copy the output from the bottom / black window

• Paste that into a reply. Please use code tags.

Binary sketch size: 450 bytes (of a 14336 byte maximum)
C:\Arduino\arduino-0022\hardware/tools/avr/bin/avrdude -CC:\Arduino\arduino-0022\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega168 -cstk500v1 -P\.\COM6 -b19200 -D -Uflash:w:C:\DOCUME~1\Owner\LOCALS~1\Temp\build1661922824292464982.tmp\null.cpp.hex:i

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

System wide configuration file is "C:\Arduino\arduino-0022\hardware/tools/avr/etc/avrdude.conf"

Using Port : \.\COM6
Using Programmer : stk500v1
Overriding Baud Rate : 19200
Here is the error messages, I don't know what you mean by code tags or how to get them.

avrdude: ser_open(): setting dtr
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv:
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: Send: Q [51] [20]
avrdude: Recv:
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

avrdude done. Thank you.

Jim