For the past two and a half days and until 2 or 3 am in the morning I've been obsessively attempting to resolve the latest incantation of the dreaded
avrdude: stk500_getsync(): not in sync: resp=0x00
error that you can experience when attempting to upload a sketch to your board via a serial interface. I've Googled, I've searched, I've tried all manner of remedies, all to no avail. Because the aforementioned remedies were rather widespread in the Internet, I thought I'd start "the ultimate" thread that addresses the issue. It's kinda dangerous to make such a statement, I realize. I don't claim to be an expert, just someone who is trying to get something working but this is standing in my way. Perhaps others can contribute their experiences and solutions to the thread, in the hope that it would help others in the future.
So a bit of background. From my research, this error essentially means that whatever you are using to upload sketches to your board cannot communicate with the uC on that board. IOW your board isn't responding to your attempts to upload a sketch.
Specifically in my case, I have a custom-designed PCB that uses a 1284p (Bobuino variant via CrossRoads); I have a serial header on my PCB that should enable me to upload sketches serially and also to see serial data from the board for the purposes of debugging. In my case I am communicating with my PCB using the Arduino IDE on my laptop computer. I use one of the USB ports to run a USB cable to an FTDI breakout. Then I use simple female-to-female electronics-project style (0.1") wiring to connect the standard 6-line serial output from that breakout to the serial header on my PCB. Cross looked at a couple of my boards last weekend and told me that he was able to upload the Blink sketch via the serial header on my board. Therefore that tells me that the board is working ok and further that there is something wrong in my configuration. Somewhere. But I'll be @#&*#@$^ if I can find it thus far. The pin connections from the breakout to the serial header are:
BREAKOUT SERIAL HEADER ON PCB
Vcc +5V
CTS CTS (this is a rarely used pin)
GND GND
Rx Tx
Tx Rx
DTR DTR (this pin is connected to the RESET trace via a 0.1uF cap)
Often the cause of this no-response scenario is rather simple, but I have also read stories of folk encountering a much more difficult time in finding resolution. And those folk, like me, were at their wits-end and were willing to try most anything to "fix it." With that in mind, here is a compilation of the possible solutions that I have attempted thus far. Try these as a first-stab:
- Check your physical connections. Ensure that your pinout is correct from the breakout to your board.
- If using the Arduino IDE, ensure that the correct COM port is selected in the Tools menu (should have a check mark next to it)
- Ensure that you have first installed the correct bootloader for your chip; you won't be able to do this serial I/O stuff without the correct boatloader being successfully installed. This must happen PRIOR to you attempting any serial I/O.
- Press the RESET button prior to your sketch being uploaded. Sometimes the DTR function on your header isn't working properly and so your uC RESET line isn't being brought low prior to the upload. If this corrects the problem, then you need to re-check how you have your DTR implemented on your board.
- Disconnect all wires that run to your Rx pin 0. Then try to upload again.
- Check your driver. Perhaps consider using a different driver version or different driver altogether. Uninstall and re-install your driver.
- Another of the common causes is a comm speed differential between the device you are attempting to upload sketches with and your board. Ensure that these match.
8 ) Try a new serial cable. - Try a different device to upload your sketch with.
And the list goes on if you Google enough. There are cases of the Uno not responding, so a reflashing of the hex file that handles serial communication is needed. But that doesn't apply to my implementation since I'm not using an Uno. And so I moved on.
I haven't tried numbers 8 or 9 yet, as those aren't readily available to me. I might have another USB cable that I could try, but I don't have another FTDI breakout to try with. The next step is to order one I suppose.