Building an ARM Cortex-M3 toolchain

For programming ARM microcontrollers (including the STM32) you need an ARM toolchain.

Components

 * gcc: The GNU GCC ARM compiler
 * binutils: The GNU assembler, linker and binary utilities
 * newlib: The newlib C library
 * gdb: The GNU debugger (optional)

Building the toolchain
You can perform the steps manually of course, but it's probably easier to get the summon-arm-toolchain script. This script supports both, Linux, and Mac OS X.

$ git clone git://github.com/esden/summon-arm-toolchain.git $ cd summon-arm-toolchain

You might want to edit the summon-arm-toolchain script now to match your preferences, then:

$ ./summon-arm-toolchain

This will download and build all required components, and then install the toolchain into $(HOME)/sat. The compile process will require quite a lot of time and disk space.

Further resources

 * Uwe Hermann: Building an ARM cross-toolchain with binutils, gcc, newlib, and gdb from source
 * Piotr Esden-Tempski: How to build arm gnu gcc toolchain for Mac OS X