[Found a work around]:Intermittent upload failures on Arduino Uno

I have been working with a particular Arduino Uno board for a short time and after several successful uploads, uploads begin to fail with the ubiquitous

avrdude: stk500_getsync(): not in sync: resp=0x30

error.

I have been through multiple online searches for a solution and verified that the boot loader is present, right COM port is selected and proper driver is installed. The maddening thing is that once I get the error using one particular PC to program the Uno and then take the Uno to another PC I can then upload once again. This generally continues for a time then the problem of upload failures returns. Iterating through the various USB ports on the PC after the failure starts does not solve the problem.

I've used 4 different PCs all running Windows 7; one Professional 64-bit, two 32-bit and one Windows 7 Home. I am using the Arduino 1.0.3 IDE and my basic upload test is uploading the sample blink program.

Performing an upload with the Shift button held down yields the following error;

avrdude: usbdev_open(): did not find any USB device "usb"

Any suggestions on what to try next?

I am about to invest in another USB cable and if that does not work pick up another UNO.

Best Regards

Mike

mpeterson64:
Performing an upload with the Shift button held down yields the following error;

avrdude: usbdev_open(): did not find any USB device "usb"

Upload with Shift will try to upload the sketch using a programmer. I don't believe this is what you are tyring to accomplish, so that error is expected if you are not trying to program via a programmer.

If you are trying to get Verbose compiler output, go to Preferences and then select the verbose output checkbox.

Thank you for the response. I updated to Arduino 1.0.4 and ran the loop back test which worked fine. After setting my preferences in the IDE for verbose output during upload I get the following;

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

avrdude done. Thank you.

Any thoughts?

Best Regards

Mike

Try holding the reset button while selecting upload.
Continue to hold the reset button during the compile phase.
Release the reset button when you see uploading in the output section.

If this works, then there is something wrong with the Auto-Reset mechanism.

Louis

Thanks again for the fast reply. I held down the reset while compiling, released it when I saw uploading and got the same error. Also tried releasing before I saw uploading and holding down the whole time just to experiment. Same error each time.

Best Regards

Mike

If you look at Task Manager and list processes, do you see any avrdude processes?

If so, kill them.

Then try uploading again.

I am assuming that you are still able to upload using a different machine, therefore we know the Uno is okay and we are focusing on what is wrong with Windows.

I didn't find any avrdude processes running. I watched the process list as a tried to upload and there was an avrdude process running during the upload attempt but it exited after the upload failure

I was able to upload blink on another computer this morning. I tried this after getting the first few upload failures on PC I am working with now.

Sorry, but I have run out of ideas at the moment.

I hope you come up with a solution as I am having the same problem. I was using UNO and switched to a new atmega328 and had the same problems. It's not the board and it's not the computer, and the program was previously working.

Unfortunately not as of yet. I am going to continue to Google and will post any new findings.

I did try one thing that temporarily corrected the problem. I unhooked everything from the Arduino board and loaded a simple blink program. It loaded without the sync error and it worked. I then hooked up the other circuit (in my case a sound board) and it crashed again with the sync error. I even when back, unhooked everything and tried one wire at a time, but when I put power to the other board, it crashed. I have been running this same circuit and code for several days without issue. However, I did note that there was a Windows update a day or two ago. I wonder is something Windows updated has clashed with Arduino code???

Well somehow it seems my problem has magically corrected itself. Here is what I did.

  1. Bought a new Arduino Uno board
  2. Connected the old Arduino Uno board with which I was having the intermittent upload problem to my PC. It came up on COM3
  3. Started up the 1.04 IDE, attempted to upload Blink and received the same upload errors
  4. Leaving the IDE running, I disconnected the old Arduno Uno and connected the new one. It came up on COM4.
  5. Went into device manage on the PC, right-moused, selected Properties->Port Settings->Advanced, and changed the port to COM3. The pc warned i had a device was on COM3 but I ignored it.
  6. Uploaded blink and fade to the new Arduino. Everything worked fine.
  7. Swapped the old Arduino back in. It came up on COM3
  8. Uploaded blink and another sketch. BOTH WORKED!!!

I still don't know the root cause but I am developing a theory that Windows 7 and the driver or the Arduino retains some kind of "memory or state" of previous devices connected to COM ports and simply pulling the USB cable does not flush this memory. With some linger memory of the old state, trying to upload to a newly connected device on the same COM port fails.

Anybody think my theory holds water or can point me in a new direction?

It's nice that you outlined your procedure. I have also been able to get the error msg to dissappear but never was sure exactly what I did. However, it still returns from time to time and by switching out boards, reinstalling com ports, etc, I eventually get it back working. I think your theory has some merit but I am not an expert enough to really know.

Thanks for sharing your "fix" - better to know the fix than the root cause anyway.