Has anyone had any luck getting the Mega 2560 to work with the eclipse AVR plugin? I can get the Arduino IDE to upload to the board but I cannot for the life of my get it to function in Eclipse.
I was able to reflash the bootloader using AVR studio and an ISP programmer with the .hex included with the Arduino IDE and from there it will allow me to program from Eclipse one time using stk500v2. After that I go back the the same "stk500_get_sync()" error and it will not allow for a reflash. The board still blinks twice when it is reset, so I am assuming the bootloader is still loaded.
Any help is appreciated.
edit: It seems like the second time flashing it does not reset the board to go into the bootloader. When the bootloader is all that it has it stays in that mode and accepts the load.
Looking again, the second time it does reset, send and recieve both flash very briefly and then it times out and the original program comes back.
Last modification, I swear! If I hit reset right before I click the avr upload button in eclipse it works. So the problem is back to not reseting. What I'm not clear on is that the Arduino IDE resets the board fine, but Eclipse using the same avrdude command line does not. The only difference I noticed is that when Arduino calls it, the hex file part ends in a ":i" and eclipse calls it with a ":a"
I’ve been playing with the problem today as I have just received my Mega 2560 last week.
I changed from my 1280 config in eclipse to the 2560 and was getting out of sync and no read response errors but have found a solution that works for me.
If you turn on the verbose option for AVRDUDE in eclipse (option -v lowercase) then it shows that the version of avrdude included with eclipse v5.1, arduino ide uses version 5.4.
I just copied avrdude.exe from
and the avrdude.conf file from
and put them into the WinAVR/bin directory (overwriting the winavr versions
then I set the AVR options as follows in my eclipse project settings :-
AVR->AVRDUDE->Programmer Configuration :-
avrdude -cstk500v2 -P\.\COM8 -b115200
MCU Type : ATMega2560
Change com port to suit your config.
Bit of a noob when it comes to eclipse so don’t ask me why it works it just does (for me anyway) - works every time
This is my first post as I’ve only just joined the forum so please be gentle with me!
hmm, as long as it works :P
I will give it a try today when I get home. Thanks!
I can't give you the gory details but I think it involves the method that is used to reset the arduino board connected to the comm port. In older versions of the IDE the IDE did the toggling of the DTR comm control signal which then resets the board, and then the IDE passed on to AVRDUDE to actually perform the upload. In newer versions of AVRDUDE and the IDE, the IDE does not issue the DTR, but rather AVRDUDE handles it.
So my guess is you need a newer version of AVRDUDE, or a properly setup avrdude config file and or the new avrdude option command to handle the dtr action.
Something like that. :D
I tried what MadmanK posted and it worked like a charm ... Thanks! No more trying to hit reset right as I hit upload :)