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:
Build it with the normal series of auto tools commands:

$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: Copy the and libftd2xx.a to /usr/local/lib and make symlinks with the names and

I downloaded and compiled openOCD 0.6.0 from here and build it with:

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

$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: before configuring and buildng openOCD

2 kommentarer:

  1. Thank you for posting this - I referenced this when I set up my Tiny H programmer in Ubuntu 12.04. I decided to post some old instructions (which I updated for 12.04 and which are similar to yours), and also some troubleshooting knowledge that I gained during the process: . I've had pretty good experience using Ubuntu's libFTDI package. Also, note that I tried the --enable-ftdi and --enable-ft2232_ftd2xx configure options, but had some compile errors. I found that it compiled OK when using the --enable-ft2232_libftdi option instead, which is what I've always used in the past.

    - Andre

  2. Thank you Andre! I had a look at your post and I think it's good if all the details and combinations of this is easily accessible. The tools are great when they work. One just wish that they would be better documented.