Having trouble with the AVR-ISP-MK2

Started by kimdrummel, July 14, 2016, 11:17:06 PM

Previous topic - Next topic

kimdrummel

Hi!

I just bought an AVR-ISP-MK2 programmer to replace my USBtinyISP programmer that always caused corrupt boot loader flashes on my arduino projects. So i thought i should get something reliable this time.

And so i bought the AVR-ISP-MK2, but all i have ever had since i bought it is headaches. I intend to use it with AVRDUDE, so i changed the firmware and did all the driver uninstalling and installing yadayada that is in the manual to make it compatible with AVRDUDE.

I am using the avrdudess gui for much easier use. But all i get is this when trying to detect the Mega2560:

avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: stk500v2_getsync(): timeout communicating with programmer

avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: stk500v2_recv_mk2: error in USB receive
avrdude.exe: stk500v2_recv_mk2: error in USB receive

And this goes on and on. This is the line i am using: -c avrispmkII -p m2560 -P usb -b 115200

I get the same message when trying to burn the 2560 bootloader in the arduino software.

I have used jumper cables to convert the 10 pins to 6 pins. I have checked and re-checked them so that i am absolutely sure they are routed to the right pins. It does not matter i they are connected though. I still get the same messages from avrdude.

Also when avrdude starts to try and connect to the programmer, the yellow/green led lights up as if something is happening, and only the red one is lit when doing nothing after killing the instructing in avrdude.

What am i doing wrong? I thought this programmer was supposed to be a lot easier and better than my last one, but as it is now, all it does is causing me even more trouble.

LubOlimex

Hey,

This post applies here I think: https://www.olimex.com/forum/index.php?topic=5358.0

Please test if the behavior persists with older AVRDUDE version - pre 6.x.x. If the problem does not occur with the older version then it is the well know issue between AVR-ISP-MK2 and the newer versions of AVRDUDE.

As you know Arduino IDE uses AVRDUDE. New versions of AVRDUDE (after version 6.x.x) have a bug that prevent LUFA-based devices (like AVR-ISP-MK2) to operate properly. This is described in the FAQ of the tool:

"
I have performed a firmware switch. My drivers are properly installed. Still I can't properly program my target with AVRDUDE. I also tested with the latest Arduino IDE. What is the problem? Is my programmer bricked?
The hardware of your AVR-ISP-MK2 is fine. There is a software bug that affects LUFA-based programmers in newest releases of AVRDUDE. Either use AVRDUDE versions prior to 6.x.x or apply this patch - https://www.olimex.com/Products/AVR/Programmers/AVR-ISP-MK2/resources/endpointdetect_pass1.patch - to the AVRDUDE sources and compile.

The same problems appears in newest releases of Arduino IDE – they use AVRDUDE versions 6.0.1 or newer. The last suitable Arduino IDE version that uses pre-6.x.x AVRDUDE version is Arduino IDE 1.5.7.

The official bug report is here: https://savannah.nongnu.org/bugs/index.php?40831

More about the issue can be found here: http://www.avrfreaks.net/forum/lufa-based-avrisp-mkii-doesnt-work-avrdude-601

"

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

dorito

Please forgive my ignorance, how does one go about applying this patch?

LubOlimex

Hey,

You need to apply the patch to the sources of avrdude and then build avrdude.

Basically you need to checkout the sources of avrdude, then navigate to the main folder of the sources, then copy the patch in the same folder, then apply the patch to the sources with a command like ("cat endpointdetect_pass1.patch | patch -p0") and, finally, build avrdude.

I recommend you this blog post: http://www.labor19.net/index.php/microcontroller/44-avrdude-patch

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

lmagalhaes

And for people using windows, what would be the way to apply the patch ?

Thanks