Topic: Sync Error Uploading firmware with Arduino 1.0.5/avrdude 5.11
I wanted to share my experiences in hopes in will help someone else.
- UPLOAD ERRORS
I recently purchased a LCD/SD board off ebay, along with a new ATMEGA1284p chip (with bootloader), but have been banging my head against the wall trying to install the new SolidoodleMarlin firmware on the new chip. Using the Arduino 1.0.5 package, it compiles okay, but I was always getting this dreaded error when trying to upload it, no matter what I tried to reset the board, re-plugging in cables, or changing ports:
avrdude: stk500_getsync(): not in sync: resp=0x00
- RUNNING AVRDUDE 5.11 MANUALLY
To bypass the Arduino IDE, I tried running avrdude (5.11) manually from within its installation folder (hardware\tools\avr\bin) with various commands, but I could never get the chip to respond at any baud rate, protocol, or combination of settings:
> avrdude -C ..\etc\avrdude.conf -c stk500 -p m1284p -P com4 -b38400
avrdude: stk500v2_ReceiveMessage(): timeout
At first I thought that the new chip didn't have a bootloader, but I got similar results when I put the older 644 chip back in. I thought that was odd since I updated my firmware about 8 months ago with no problem.
RUNNING AVRDUDE 5.4 MANUALLY
Finally, I realized that I had used an older version of arduino (Arduino-0022) and I found that it came with a different version of avrdude (5.4). Sure enough, with the older avrdude, and the same command above (at 38400 baud and stk500 protocol), I could now get both chips to respond:
> avrdude -C ..\etc\avrdude.conf -c stk500 -p m1284p -P com4 -b38400
avrdude: AVR device initialized and ready to accept instructions
....
I did have to copy a few lines from the 5.11 version of the avrdude.conf file so that the older version knew about the newer chip and didn't complain about a mismatched signature, but that's it.
However I couldn't open the newer SolidoodleMarlin project with the older version of Arduino, nor did I have any success overwriting the newer version of avrdude and its config file with the older ones (the Arduino IDE now returned different errors on upload).
FINDING COMPILED HEX FILE
However, I could still install the binary manually using avrdude. I found the compiled hex file on my older PC running XP in the folder: c:\documents and settings\<username>\local settings\Temp\build<nnnnnnnnnnn>.tmp
INSTALLING MANUALLY
To install the file, I used the following line:
avrdude -C ..\etc\avrdude.conf -c stk500 -p m1284p -P com4 -b38400 -U flash:w:SolidoodleMarlin.cpp.hex
and it uploaded successfully!
I welcome somebody can help explain what went wrong or how to fix it more elegantly. I had to find my way with a lot of digging and trial an error. If that's not possible, hopefully this info will be helpful.
