FTDI Drivers for AVRDude in Linux
UPDATE: David at doswa.com was able to get the FTDI driver working with avrdude 5.8. Go check out his site for some great instructions!
After some struggling with reading Google’s interpretation of Japanese, I finally got “z’s” instructions for getting the FTDI driver for Linux working with avrdude. My goal was to perform Kimio Kosaka’s Arduino bootloader burning trick. All in all, it’s pretty simple, but the translation was utter garbage.
FYI, I’m running Ubuntu 9.04, 64-bit, but I’m fairly confident this will work on any distro. With that in mind, I’m leaving out distribution specific instructions (like using apt-get to install libusb-dev).
Once again, this is entirely from Mr. Z…I’m just making it English-readable :)
-
Requirements:
- libreadline source
- libncurses source
- libtermcap source
- libusb source
-
Downloads:
- Avrdude-5.3.1
- Serjtag-0.3
- libftd2xx0.4.16 (note the different downloads for x86 and x86_64!)
-
Untar your three new downloads. For me, they’re going into ~/installs:
/installs/avrdude-5.3.1/ /installs/serjtag-0.3/ /installs/libftd2xx0.4.16_x86_64
-
Patch avrdude using the patches included with serjtag:
cd ~/installs/avrdude-5.3.1 patch <../serjtag-0.3/avrdude-serjtag/src/avrdude-5.3.1-usb910.patch patch <../serjtag-0.3/avrdude-serjtag/src/avrdude-5.3.1-avr910d.patch patch <../serjtag-0.3/avrdude-serjtag/src/avrdude-5.3.1-serjtag.patch patch <../serjtag-0.3/avrdude-serjtag/src/avrdude-5.3.1-ft245r.patch patch <../serjtag-0.3/avrdude-serjtag/src/avrdude-5.3.1-baud.patch
-
Copy the FTDI drivers into the avrdude directory:
cp ../libftd2xx0.4.16_x86_64/ftd2xx.h ./ cp ../libftd2xx0.4.16_x86_64/WinTypes.h cp ../libftd2xx0.4.16_x86_64/static_lib/libftd2xx.a.0.4.16 ./
-
Run the configure script
./configure
-
Edit the Makefile, and make sure the following two lines match:
CFLAGS = -g -O2 -DHAVE_LIBUSB -DSUPPORT_FT245R LIBS = -lreadline -lncurses -ltermcap ./libftd2xx.a.0.4.16 -lrt
-
Build it!
make
Now, before I go any further, stop and think before you reflexively jump into a make install. If you’re like me, you probably already have avrdude installed (I’m running 5.5, and this is 5.3), and don’t want to mess it up. For me, this version of avrdude is “specialized” and will only be used when I’m burning my bootloader, so I don’t want it leaving this directory. So, I’m going to continue under that assumption.
-
Copy serjtag’s avrdude.conf into the avrdude directory:
cp ../serjtag-0.3/avrdude-serjtag/binary/avrdude.conf ./
-
Copy and link the FTDI drivers:
cd /usr/lib sudo cp ~/installs/libftd2xx0.4.16_x86_64/libftd2xx.so.0.4.16 ./ sudo ln -s libftd2xx.so.0.4.16 libftd2xx.so sudo ln -s libftd2xx.so.0.4.16 libftd2xx.so.0
Now, you can continue on, and use Kimio’s instructions for burning the bootloader. As a heads up, though, you WILL need to specify the new avrdude.conf file when you run the serjtag-modified avrdude (as well as specifying your arduino’s port):
./avrdude -C avrdude.conf -c diecimila -P ttyUSB0 -p m168 -t -B 4800
I also found that, given my permissions, I have to run this with root permissions. When I’m less lazy, I’ll flip the switches to give my regular user access to ttyUSB.
Go forth and hack your Arduino!