This is a read-only archive of an earlier blog posting. Reasons for the change are at

The permanent version of this post - with comments (if any) - is at

STM32 on Linux, again.

Starting another project using the STM32 micro, so time to update and reinstall the toolchain. This is an update to my previous post on the topic at


Previously I used the summon-arm gersion of GCC
but the git repo says it's "not under active development" any more. They recommend , which seems to be an offically ARM-supported

It looks like Debian has packaged the launchpad version into the "unstable" branch: but I'm running "stable" so I got it directly from launchpad instead. Install was simple:

That's my setup, the chosen directory is just a matter of personal preference.

Programming tools:

I'm using the STM32F4DISCOVERY board for development, so there are two ways to get code
into the chip:
  1. Use the st-link USB input to the built-in programming hardware.
  2. Connect directly to the USB port of the STM32F4 chip and use dfu-util.
I used dfu-util before. That's now in Debian, and should still work but I haven't retested it.

Code for the st-link interface is available and built with no problem:
Programs are installed in /usr/local/bin: st-flash st-info st-term st-util

An example was successfully placed in flash using:
st-flash write *.bin 0x8000000


The open source libraries and examples at built without problem using the launchpad compiler. My build command was:
PATH=/usr/bin:/bin:/opt/gcc-arm-none-eabi/bin DESTDIR=/opt/libopencm3 make install

ST has standard peripheral library source code on their website, but it doesn't come with Makefiles. A USB serial example at includes some (all?) of the ST libraries and compiles fine with the launchpad compiler. I downloaded and unpacked and "make" ran without problems. I only had to change the top-level Makefile so that BINPATH points to the directory that arm-none-eabi-gcc is in
(BINPATH=/opt/gcc-arm-none-eabi/bin for my install).

Comments on

To make or view comments, see the original post at