Bare-metal Cortex-M3 Evaluation Kits on Fedora F14

This page describes basic steps needed to:

The instructions have been tested with Stellaris EKK-LM3S811 evaluation kit.

Board Connection

  1. install openocd
    yum install openocd
    
  2. Connect the board to the computer, and start the openocd daemon as root:
    openocd -f interface/luminary-lm3s811.cfg -f board/ek-lm3s811.cfg 
    
  3. Connect to the control port of the daemon:
    telnet localhost 4444
    
  4. Type eg
    reset halt
    
  5. Write one of the demo programs available on the kit's CD
    flash write_image erase /home/pawsa/dev/stellaris/./stellarisware/boards/ek-lm3s811/blinky/sourcerygxx/blinky.bin
    
  6. ... and start it
    reset
    

Compiler Configuration on F14

  1. Download avr-binutils.spec (eg. by downloading avr-binutils.src.rpm)
  2. Apply following patch to avr-binutils.spec:
    diff --git a/avr-binutils.spec b/avr-binutils.spec
    --- a/avr-binutils.spec
    +++ b/avr-binutils.spec
    @@ -1,4 +1,4 @@
    -%define target avr
    +%define target arm-unknown-elf
     
     Name:           %{target}-binutils
     Version:        2.21
    
  3. build rpm using: rpmbuild -ba avr-binutils.spec.
  4. install the built arm-unknown-elf-binutils....rpm package.
  5. download avr-gcc.spec
  6. Apply the following patch to it:
    diff --git a/avr-gcc.spec b/avr-gcc.spec
    --- a/avr-gcc.spec
    +++ b/avr-gcc.spec
    @@ -1,4 +1,4 @@
    -%define target avr
    +%define target arm-unknown-elf
     
     Name:           %{target}-gcc
     Version:        4.5.1
    @@ -12,6 +12,7 @@ Source1:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{version}/gcc-g++-%{version}.tar.
     Source2:        README.fedora
     Patch0:         avr-gcc-4.5.0-new_devices.patch
     Patch1:         avr-gcc-4.5.1-register-fix.patch
    +Patch2:         arm-gcc-4.5.1-build.patch
     
     BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
     BuildRequires:  %{target}-binutils >= 2.13, zlib-devel gawk gmp-devel mpfr-devel libmpc-devel
    @@ -39,6 +40,11 @@ platform.
     pushd gcc-%{version}
     %patch0 -p0
     %patch1 -p1
    +%patch2 -p2 -b .arm
    +
    +find . -name configure.ac | xargs perl -pi -e 's,\(2.64\),(2.66),g'
    +find . -name override.m4 | xargs perl -pi -e 's,2.64,2.66,g;'
    +autoreconf
     
     contrib/gcc_update --touch
     popd
    @@ -71,8 +77,9 @@ pushd gcc-%{target}
     CC="%{__cc} ${RPM_OPT_FLAGS}" \
     ../gcc-%{version}/configure --prefix=%{_prefix} --mandir=%{_mandir} \
       --infodir=%{_infodir} --target=%{target} --enable-languages=c,c++ \
    -  --disable-nls --disable-libssp --with-system-zlib \
    +  --disable-nls --disable-libssp --disable-zlib \
       --enable-version-specific-runtime-libs \
    +  --without-headers \
       --with-pkgversion="Fedora %{version}-%{release}" \
       --with-bugurl="https://bugzilla.redhat.com/"
     # In general, building GCC is not smp-safe
    
    We add an additional patch, and assure that gcc's configure.ac scripts do not panic when encountering more recent autoconf version. We disable also gcc features that require libc.
  7. This modified spec file refers to the following gcc patch: arm-gcc-4.5.1-build.patch
    
    --- arm-unknown-elf-gcc-4.5.1/gcc-4.5.1/configure.ac.arm	2010-06-24 23:06:37.000000000 +0200
    +++ arm-unknown-elf-gcc-4.5.1/gcc-4.5.1/configure.ac	2011-01-22 19:53:57.838808864 +0100
    @@ -30,7 +30,7 @@
     m4_include([lt~obsolete.m4])
     
     AC_INIT(move-if-change)
    -AC_PREREQ(2.64)
    +AC_PREREQ(2.66)
     AC_DISABLE_OPTION_CHECKING
     
     progname=$0
    @@ -589,7 +589,7 @@
         libgloss_dir=arm
         ;;
       arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
    -    noconfigdirs="$noconfigdirs target-libffi target-qthreads"
    +    noconfigdirs="$noconfigdirs target-libffi target-qthreads target-libiberty target-libstdc++-v3 ${libgcj}"
         libgloss_dir=arm
         ;;
       arm*-*-linux-gnueabi)
    
    The purpose of the patch is to block building target-libiberty. We probably want to block it only for arm-unknown-*, not for all ARM architecture types.
  8. Build rpm using: rpmbuild -ba avr-gcc.spec.
  9. Install the built arm-unknown-elf-gcc....rpm package.

You should be ready to go!

Go back to Pawel Salek's home page.