ARM

1. Ingenieurpraxis

to be continued

 

2. Begriffserklärung

ARM: Advanced RISC Machines
Toolchain: Sammlung von Cross-Compilern und Debuggern
Cross-Compiler: Compiler für unterschiedliche Host-Systeme und Ziel-Systeme
arm-none-eabi: none: ohne OS (bare-metal), eabi: embedded-application binary interface Binärschnittstelle

 

3. Toolchain

 
3.1. Manuelle Installation
Folgende Pakete müssen vorher installiert werden:
sudo apt-get install libftdi-dev libftdi1 libtool git-core asciidoc build-essential flex bison libgmp3-dev libmpfr-dev autoconf texinfo libncurses5-dev libexpat1 libexpat1-dev tk tk8.4 tk8.4-dev openocd
toolchain
export MYTOOLS=~/site
export ARMDIR=~/arm
mkdir -p $ARMDIR
mkdir $ARMDIR/orig
mkdir $ARMDIR/src
mkdir $ARMDIR/build
mkdir -p  $MYTOOLS
cd $ARMDIR/orig
wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.6.3/gcc-4.6.3.tar.gz
wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.6.3/gcc-core-4.6.3.tar.gz
wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.6.3/gcc-g++-4.6.3.tar.gz
wget ftp://ftp.gnu.org/gnu/gdb/gdb-7.4.1.tar.gz
wget ftp://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.gz
wget ftp://sources.redhat.com/pub/newlib/newlib-1.20.0.tar.gz
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-0.8.1.tar.gz
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-2.4.2.tar.bz2
cd ../src
tar xzvf ../orig/gcc-4.6.3.tar.gz
tar xzvf ../orig/gcc-core-4.6.3.tar.gz
tar xzvf ../orig/gcc-g++-4.6.3.tar.gz
tar xzvf ../orig/gdb-7.4.1.tar.gz
tar xzvf ../orig/binutils-2.22.tar.gz
tar xzvf ../orig/newlib-1.20.0.tar.gz
tar xjvf ../orig/gmp-4.3.2.tar.bz2
tar xzvf ../orig/mpc-0.8.1.tar.gz
tar xjvf ../orig/mpfr-2.4.2.tar.bz2
cd ../build
mkdir ./binutils-2.22
cd ./binutils-2.22
../../src/binutils-2.22/configure --target=arm-none-eabi --prefix=$MYTOOLS --enable-interwork --enable-multilib
make all install
export PATH="$PATH:$MYTOOLS/bin"
mkdir $ARMDIR/build/gcc-4.6.3
mkdir $ARMDIR/build/mpc-0.8.1
mkdir $ARMDIR/build/gmp-4.3.2
mkdir $ARMDIR/build/mpfr-2.4.2
cd $ARMDIR/build/gmp-4.3.2
../../src/gmp-4.3.2/configure --prefix=$MYTOOLS --disable-shared --enable-static
make
make install
make check
cd $ARMDIR/build/mpfr-2.4.2
../../src/mpfr-2.4.2/configure --prefix=$MYTOOLS --with-gmp=$MYTOOLS --disable-shared --enable-static
make
make install
make check
cd $ARMDIR/build/mpc-0.8.1
../../src/mpc-0.8.1/configure --prefix=$MYTOOLS --with-gmp=$MYTOOLS --with-mpfr=$MYTOOLS --disable-shared --enable-static
make
make install
make check
cd $ARMDIR/build/gcc-4.6.3
../../src/gcc-4.6.3/configure --prefix=$MYTOOLS --target=arm-none-eabi --enable-interwork --enable-multilib --enable-languages="c,c++" --with-newlib --disable-nls --disable-shared --disable-threads --with-gnu-as --with-gnu-ld --with-gmp=$MYTOOLS --with-mpfr=$MYTOOLS --with-mpc=$MYTOOLS --with-headers=../../src/newlib-1.20.0/newlib/libc/include --with-system-zlib
make all-gcc
make install-gcc
mkdir $ARMDIR/build/newlib-1.20.0
cd $ARMDIR/build/newlib-1.20.0
../../src/newlib-1.20.0/configure --target=arm-none-eabi --prefix=$MYTOOLS --enable-interwork --enable-multilib
make all
make install
cd $ARMDIR/build/gcc-4.6.3
make all
make install
mkdir $ARMDIR/build/gdb-7.4.1
cd $ARMDIR/build/gdb-7.4.1
../../src/gdb-7.4.1/configure --target=arm-none-eabi --prefix=$MYTOOLS --enable-interwork --enable-multilib
make all
make install

 

 
3.2. Installation per Skript

summon-arm-toolchain
GNUARM
CodeSourcery

 
3.3. OpenOCD

im Verzeichnis mit main.bin ausführen:
openocd -f rlink.cfg
mit rlink.cfg(auch im selben Verzeichnis):

source [find interface/rlink.cfg]
source [find target/stm32f1x.cfg]

$_TARGETNAME configure -event reset-init {
mww 0x40022000 0x32
mww 0x40021004 0x3c0400
mww 0x40021000 0x01000883
sleep 10
mww 0x40021004 0x3c0402
sleep 10
adapter_khz 3000
}

init
reset init
poll off
stm32f1x mass_erase 0
flash write_image main.bin 0x08000000
verify_image main.bin 0x08000000
shutdown
 

4. IDE

 
4.1. Eclipse

 

 
4.2. Code::Blocks

The open source, cross platform, free C++ IDE.
http://www.codeblocks.org/downloads/26

 
4.3. Crossworks

Commercial $1500 Upgrade $750
Educational $300 Personal $150
30 Tage Testversion

 
4.4. Sourcery CodeBench

30-day trial

 
4.5.

 

 
4.6. ATOLLIC TrueSTUDIO

Windows only

 
4.7. CooCox

kostenlos
Windows only

 
4.8. RAISONANCE RIDE7

Windows only

 

5. FreeRTOS

 

6. Vor- und Nachteile

 

7. Benchmark

 

8. Links

Einrichten der Toolchain, OpenOCD etc.