I have chosen an Olimex Board (STM32-E407) since it conforms to the Arduino form factor and has a processor close to the model used by my custormer. A JTAG was and a couple of development shields were ordered as well.
Before I can get started I need a toolchain to compile my applications. I could download a prebuilt toolchain from Mentor Graphics (Code Sourcery), but I wanted to see how if I could build one myself.
I have a 32 bit Ubuntu 12.04 host, and I tried to follow two other howto’s but none of them worked, so I had to mix the instructions from both. (http://www.triplespark.net/elec/pdev/arm/stm32.html, http://jeremyherbert.net/get/stm32f4_getting_started )
First install the tools needed for building the toolchain:
$sudo apt-get install flex bison libgmp3-dev libmpfr-dev libncurses5-dev libmpc-dev autoconf texinfo build-essential libftdi-dev libzip-dev
Now clone the source repository:
Note: See the update below for instructions for GDB XML support!
$git clone git://github.com/esden/summon-arm-toolchain
Since noone else will use my toolchain I will install the toolchain in my home directory: ~/tools/arm/arm-linaro-eabi-4.6.
Build the tool chain:
$./summon-arm-toolchain PREFIX=~/tools/arm/arm-linaro-eabi-4.6/ OOCD_EN=1 TARGET=arm-none-eabi LIBSTM32_EN=1 USE_LINARO=1 CPUS=2
When done, check the result:
It should say something like this:
arm-none-eabi-gcc (Linaro GCC 4.6-2011.10) 4.6.2 20111004 (prerelease)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To be able to work efficiently on the command line I create an environment setup script. With this script I can have several different toolchains for different platforms, and different automation scripts, that doesn't pollute my systems PATH environment variables and bash setup.
Open up a text editor and create the file env.sh, looking like this:
echo "Olimex STM32-E407 Development Environment"
#Export the variables to use in the development environment
export PS1="[Olimex E407] \u@\h:\w\$ "
#Start a new shell with the exported variables
Change the mode of the file:
$chmod +x env.sh
Enter your environment:
To exit the environment shell, just type exit and you’ll be back to your normal prompt.
From here I followed the last sections in http://jeremyherbert.net/get/stm32f4_getting_started to build the first test software.
Update Sept. 17 2012
To be able to debug the target I hade to rebuild the toolchain with XML support enabled in the GDB target.
To do this you first need to install expat:
$sudo apt-get install libexpat1 libexpat1-dev
Then find the GDB build target in the automated build script named summon-arm-toolchain and add the parameter "--with-expat \" before the GDBFLAGS parameter (or add it to the GDBFLAGS variable).
Now build the tool chain according to the instructions above.