Strange avrdude problem & how to fix it

On August 31, 2010, in Tech, by tom

I was doing some development using an ATtiny26l micro and an Atmel AVRISP mk2 serial programmer tonight. I’ve been using the Eclipse IDE for C/C++ Developers with avg-gcc (via CrossPack for Macs), the AVR Eclipse Plugin, avrdude and a USB to serial dongle without a problem for the last few years, it’s not a bad environment when you get used to the eclipse quirks.

However tonight something went wrong, my Mac locked up and I had to turn it off and reboot. But on restarting I found that avrdude wasn’t working properly through Eclipse, it kept timing out.

I tried programming from the command line and it showed that while it was working, it was taking minutes to write what normally took seconds, and it was suffering from timeouts on reading back the data to verify the programming operation.

I tried different USB to serial dongles, uninstalled and reinstalled the FTDI driver, rebooted my Mac, tried a different power supply, tried programming different devices and tore my hair out – nothing appeared to fix the problem .

I then did some creative googling and found an entry on the evilmadscientist site that fixed the problem.

Head over to the site to see what I found in the context of the problem they had, but here’s what I did to fix my problem to restore normal programming speed on an ATtiny26L connected to a avrisp Mk 2 programmer via a USB to serial converter:

If avrdude is giving you grief by running slowly, eg takes minutes to program < 2k of memory in my example, open up the Mac OS X terminal and enter the following: $ avrdude -p t26 -c avrispmkII -P /dev/tty.usbserial-000041FA -tuF wait for avrdude to display its terminal mode prompt then enter avrdude> sck 10
avrdude> quit

And that’s all, avrdude should now return to normal service and program at its normal high speed.


Leave a Reply

Your email address will not be published.