Elastic Sheep

Because elasticdog was already taken

Elastic Sheep header image 2

Patching avrdude for OS X Tiger

April 2nd, 2009 · 1 Comment · Uncategorized

Until now I was using avrdude 5.3.1 provided with the OS-X AVR package to drive my AVR ISP mkII programmer. And everything was fine.

Last week I needed to upgrade my AVR toolchain. OS-X AVR is not maintained anymore so instead I installed the lastest AVRMacPack containing avrdude 5.5. The result : nothing. The programmer does not seem to respond to avrdude requests. It blinks but nothing happens. In fact it is very slow. If you wait for 5 minutes, suddenly the programmer wakes up and your program is written on the target device. Of course avrdude 5.5 and AVRISPMKII seem to work fine with Leopard but I am not willing to upgrade my OS now just for this tool.

The only solution I found: re-applying the patch that OS-X AVR was using on avrdude 5.3.1. With this patch the programmer now responds instantly and I am able to program my device without any hitch.

I am not sure this patch is without any side effect, but it will do the job until I switch to Leopard.

The patch:

*** stk500v2.c.orig Wed Dec 20 15:43:34 2006
--- stk500v2.c Sun Dec 31 13:09:39 2006
***************
*** 485,490 ****
--- 485,492 ----

if (pgmtype == PGMTYPE_JTAGICE_MKII)
return 0;
+ if (pgmtype == PGMTYPE_AVRISP_MKII)
+ return 0;

retry:
tries++;

The compilation process :

tar xzvf avrdude-5.6.tar.gz
cd avrdude-5.6
mkdir build && cd build
../configure --prefix=/usr/local/avrdude
make
sudo make install

Just add /usr/local/avrdude/bin in your $PATH to point to your patched version.

Tags:

One Comment so far ↓

Leave a Comment