fredag 14 september 2012

Setting up Olimex arm-usb-tiny-h with Ubuntu 12.04

Along with the Olimex E407 board, I also ordered an Olimex arm usb tiny h JTAG to be able to program the board. I am more convenient with working in Linux than other operating systems so I really wanted this to work with my Ubuntu 12.04 (32bit x86) installation.

This was a bit tricky, and it has taken some time to Google for all the bits and pieces that finally made it work.

First I downloaded libftdi 0.20 from here: http://www.intra2net.com/en/developer/libftdi/download.php
Build it with the normal series of auto tools commands:


$./configure
$make
$sudo make install


I am not sure if both are needed, but to be on the safe side I downloaded the ftd2xx driver and installed it as well. You can get it here: http://www.ftdichip.com/Drivers/D2XX.htm. Copy the libftd2xx.so.1.1.12 and libftd2xx.a to /usr/local/lib and make symlinks with the names libftd2xx.so and libftd2xx.so.1

I downloaded and compiled openOCD 0.6.0 from here http://openocd.sourceforge.net/ and build it with:

Note: See updated instruction regarding patch below!
$./configure --enable-ftdi --enable-ft2232_ftd2xx

$make
$make install

When plugging in the arm-usb-tiny-h, you will not be granted access by default. To handle this you have to create a rule for udev:

$cd /etc/udev/rules.d

As root, create a file named 99-olimex-arm-usb-tiny-h.rule with this content:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002a", MODE="0666"

I also removed the brltty package which might interfere with some of the ftdi drivers, but this was only a precaution. You could try running without removing it.

$sudo apt-get remove brltty

Now I run openOCD with the following command (paths relative from where I built openOCD):

$openOCD -f tcl/interfaces/ftdi/olimex-arm-usb-tiny-h.cfg -f stm32f4x.cfg

You can download the stm32f4x.cfg from Olimex web site.

Good luck!

Update Sept 17 2012
Apply the patch provided by this site: http://pastebin.com/rdFF2eZd before configuring and buildng openOCD