Skip to content

STM32 Toolchain Installation Instructions

tschmid edited this page Sep 13, 2010 · 2 revisions

Installing OpenOCD

Get the FTDI drivers from here: http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.16.tar.gz

Next, untar the driver, compile, and install it


tar xvfz libftd2xx0.4.16.tar.gz cd libftd2xx0.4.16 ./configure make sudo make install

You will also have to get openocd 0.1.0 from here http://download.berlios.de/openocd/openocd-0.1.0.tar.gz

Untar, configure, make, and install OpenOCD


tar xvfz openocd-0.1.0.tar.gz cd openocd-0.1.0/ ./configure --enable-rlink --enable-ft2232_ftd2xx --with-ftd2xx-linux-tardir=../libftd2xx0.4.16/ make sudo make install

Olimex ARM-USB-OCD JTAG

In order to make the JTAG work under Linux, add the following udev rules file into

/etc/udev/rules.d/45-ft2232.rules
with the content:

BUS!=“usb”, ACTION!=“add”, SUBSYSTEM!==“usb_device”, GOTO=“kcontrol_rules_end”
SYSFS{idProduct}"0003", SYSFS{idVendor}“15ba”, MODE=“664”, GROUP=“plugdev”
LABEL=“kcontrol_rules_end”

Restart udev:


/etc/init.d/udev reload

Now, you are ready to run openocd. Connect the JTAG to your computers USB interface and connect the Eval board to the JTAG. Then, execute:


openocd -f /usr/local/lib/openocd/interface/olimex-arm-usb-ocd.cfg -f /usr/local/lib/openocd/board/stm32f10x_128k_eval.cfg

to check if everything works.

Now, in /usr/local/lib/openocd/target/stm32.cfg change


flash bank stm32x 0 0 0 0 0

to

flash bank stm32x 0×08000000 0×20000 0 0 0

These are the right settings for the particular STM32 that we are using.

STM32 ARM Toolchain

Next, we build build the full arm-gcc toolchain for the stm32. You can get all the sources from http://projects.nesl.ucla.edu/~thomas/stm32-src_mine.tar.bz2.

Untar the sources and execute the prepared shell script that will do the rest for you. The toolchain will be installed in a local directory under ~/local/stm32


tar xvfj stm32-src_mine.tar.bz2 cd stm32-src ./build.sh

Next, add the following to your .bashrc
export PATH=$PATH:$HOME/local/stm32

That’s it. Your toolchain is ready.