[EMAIL PROTECTED] (Andrew Greenberg) writes:

> ... and so you could be the first! :) Please do let us know.

Ok, here's what I have now, won't wait until I have the FreeRTOS stuff done.
Below are my notes on what it takes to get to the point of having gdb talking
to an LPC2148 target through an Olimex USB JTAG interface.

Note that I'm running Debian 'unstable', and I have a fairly rich build
environment installed.  You may need to iterate some installing more packages
to flesh out the build dependencies.. take notes about what you have to add,
and I'll be happy to incorporate them when I get around to stuffing this on
my wiki.  Should be fairly easy, since my "notes" are loaded with the actual
commands I issued in cut'n'paste form.  I've already used these to get the
toolchain up on a second machine here (one each i386 and amd64), so I'm pretty
sure they'll work if you have the right build deps installed.

Enjoy!

Bdale


2007.07.24
- try it "my way", with some hints from the notes at http://www.gnuarm.org/

  Make sure /opt can grow by 700meg+, plus need ~2G for sources and build tree!

  Fetch upstream bits, and populate a Dist/ directory

        export MYSRCPATH=/home/bdale/src/cross-tools
        export MYPREFIX=/opt/cross

        mkdir -p $MYSRCPATH/Dist
        cd $MYSRCPATH/Dist

        wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.2.1/gcc-4.2.1.tar.bz2
        wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.2.1/gcc-4.2.1.tar.bz2.sig
        gpg --verify gcc-4.2.1.tar.bz2.sig

        wget ftp://ftp.gnu.org/gnu/binutils/binutils-2.17.tar.bz2
        wget ftp://ftp.gnu.org/gnu/binutils/binutils-2.17.tar.bz2.sig
        gpg --verify binutils-2.17.tar.bz2.sig

        wget ftp://ftp.gnu.org/gnu/gdb/gdb-6.6.tar.bz2
        wget ftp://ftp.gnu.org/gnu/gdb/gdb-6.6.tar.bz2.sig
        gpg --verify gdb-6.6.tar.bz2.sig

        wget ftp://sources.redhat.com/pub/newlib/newlib-1.15.0.tar.gz

        wget http://www.gnuarm.com/t-arm-elf

  Unpack upstream bits, and prepare build environment.  Resurrecting the
  "one-tree" script would make this more efficient, but compile cycles are
  cheap enough that it's probably not worth worrying about...

        cd $MYSRCPATH

        tar xvjf Dist/binutils-2.17.tar.bz2
        tar xvjf Dist/gcc-4.2.1.tar.bz2
        tar xvjf Dist/gdb-6.6.tar.bz2
        tar xvzf Dist/newlib-1.15.0.tar.gz
        cp Dist/t-arm-elf gcc-4.2.1/gcc/config/arm/t-arm-elf

  Resolve build dependencies (incomplete)
        sudo apt-get install texinfo

  Build it all...

        mkdir -p $MYSRCPATH/target/arm-elf/binutils
        cd $MYSRCPATH/target/arm-elf/binutils
        ../../../binutils-2.17/configure \
                --target=arm-elf --prefix=$MYPREFIX \
                --enable-interwork --enable-multilib --with-float=soft
        make all
        sudo make install

        export PATH=$PATH:$MYPREFIX/bin

        mkdir -p $MYSRCPATH/target/arm-elf/gcc
        cd $MYSRCPATH/target/arm-elf/gcc
        # following must be run as root to allow dir creation in /opt/cross!
        sudo ../../../gcc-4.2.1/configure \
                --target=arm-elf --prefix=$MYPREFIX --enable-interwork \
                --enable-multilib --with-float=soft \
                --enable-languages="c,c++" --with-newlib \
                --with-headers=../../../newlib-1.15.0/newlib/libc/include       
        make all-gcc
        sudo make install-gcc

        mkdir -p $MYSRCPATH/target/arm-elf/newlib
        cd $MYSRCPATH/target/arm-elf/newlib
        ../../../newlib-1.15.0/configure --target=arm-elf --prefix=$MYPREFIX \
                --enable-interwork --enable-multilib --with-float=soft
        make all
        # pass PATH into sudo environment so /opt/cross/bin is included
        sudo env PATH=$PATH make install

        cd $MYSRCPATH/target/arm-elf/gcc
        make all
        sudo make install

        mkdir -p $MYSRCPATH/target/arm-elf/gdb
        cd $MYSRCPATH/target/arm-elf/gdb
        ../../../gdb-6.6/configure --target=arm-elf --prefix=$MYPREFIX \
                 --enable-interwork --enable-multilib --with-float=soft
        make all
        sudo make install

- get the Olimex USB jtag dongle working with the Debian openocd package

        mkdir -p $MYSRCPATH/jtag
        cd  $MYSRCPATH/jtag

        sudo apt-get install openocd

        # create lpc2xxx_armusbocd.cfg containing content found below, which
        # was copied from somewhere I neglected to make note of, and may not
        # be *entirely* correct for this target yet!

        # power up target board, *then* the Olimex USB jtag widget, then run:
        sudo openocd -f ./lpc2xxx_armusbocd.cfg
                telnet localhost 4444
                        poll
                        halt
                        poll

- take gdb for a quick test drive

        cd  $MYSRCPATH/jtag
        # create init.gdb file containing
                target remote localhost:3333
                # monitor arm7_9 sw_bkpts enable
                monitor poll

        arm-elf-gdb --command init.gdb
                 info registers


- - - - - lpc2xxx_armusbocd.cfg - - - - -

#daemon configuration
telnet_port 4444
gdb_port 3333
#interface
interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG"
ft2232_layout "olimex-jtag"
ft2232_vid_pid 0x15BA 0x0003
jtag_speed 3
#use combined on interfaces or targets that can't set TRST/SRST separately
#reset_config trst_and_srst separate
reset_config trst_and_srst srst_pulls_trst
#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag_device 4 0x1 0xf 0xe
#target configuration
daemon_startup reset
#target <type> <startup mode>
#target arm7tdmi <reset mode> <chainpos> <endianness> <variant>
target arm7tdmi little run_and_init 0 arm7tdmi-s_r4
run_and_halt_time 0 30
#target_script 0 reset scripts/oocd_flash_lpc2148.script
working_area 0 0x40000000 0x40000 nobackup
#flash configuration
flash bank lpc2000 0x0 0x7D000 0 0 lpc2000_v2 0 14765 calc_checksum
arm7_9 swbkpts enable
# For more information about the configuration files, take a look at:
# http://openfacts.berlios.de/index-en.phtml?title=Open+On-Chip+Debugger

- - - - - 

_______________________________________________
psas-avionics mailing list
psas-avionics@lists.psas.pdx.edu
http://lists.psas.pdx.edu/mailman/listinfo/psas-avionics

Reply via email to