Re: [psas-avionics] Olimex JTAG programming under Linux

2007-07-25 Thread Bdale Garbee
[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 
poll
halt
poll

- take gdb for a quick test drive

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

a

Re: [psas-avionics] Olimex JTAG programming under Linux

2007-07-24 Thread Andrew Greenberg
Hi Bdale,

Welcome to the avionics list!

> I personally don't think I want or need Eclipse...

We have lots of people who are not using Eclipse, but none have written
up as nice directions on how to go about development under linux using
LPC2148 and FreeRTOS.

> Once I have that working, I intend to publish my notes on what I've
> done.  Maybe by this weekend.

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

Andrew

-- 
---
Andrew Greenberg

Portland State Aerospace Society (http://psas.pdx.edu/)
[EMAIL PROTECTED]  P: 503.788.1343  C: 503.708.7711
---

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


Re: [psas-avionics] Olimex JTAG programming under Linux

2007-07-24 Thread Bdale Garbee
[EMAIL PROTECTED] (Andrew Greenberg) writes:

> Wow - 5 points for Dave!! That's awesome Dave, thanks. I'll walk through
> your instructions this week.

FYI.

I personally don't think I want or need Eclipse, and am intent on using a 
combination of things that are pre-packaged for Debian (like openocd) and 
source vs grabbing pre-built binary trees from semi-random places.  So I've
done something similar but different in preparation for the work I'm planning
to do here.  I'm now to the point of having arm-elf-gdb happily talking to 
one of the little Olimex LPC2148 boards through an Olimex USB JTAG dongle.

What I'm working on now is a single source tree for a trivial demo app (blinky
LED'ish) using FreeRTOS that I can build with this toolchain for the LPC2148, 
and also with SDCC for a PIC 18F2550.  Once I have that working, I intend to 
publish my notes on what I've done.  Maybe by this weekend.  

Bdale

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


Re: [psas-avionics] Olimex JTAG programming under Linux

2007-07-23 Thread Andrew Greenberg
Wow - 5 points for Dave!! That's awesome Dave, thanks. I'll walk through
your instructions this week.

Andrew

Dave Camarillo wrote:
> I've successfully gotten my linux box up and running for JTAG flash
> programming of the Olimex boards, arm7 compilation of FreeRTOS and
> eclipse setup. I've put the instructions and gotchyas on the setup page,
> http://psas.pdx.edu/OlimexLPC2148Setup  . If other people are able to
> get up and running under Linux I'd be curious to know of any other
> platform/OS specific gotchas you run into.
> 
> Thanks,
> -Dave
> 
> 
> 
> 
> ___
> psas-avionics mailing list
> psas-avionics@lists.psas.pdx.edu
> http://lists.psas.pdx.edu/mailman/listinfo/psas-avionics

-- 
---
Andrew Greenberg

Portland State Aerospace Society (http://psas.pdx.edu/)
[EMAIL PROTECTED]  P: 503.788.1343  C: 503.708.7711
---

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