#!/bin/bash
PREFIX=/usr/local/lpc4.1.1
DIR=`pwd`
rm -rf $PREFIX
mkdir $PREFIX
cd $PREFIX
tar -xvf $DIR/newlib-1.14.0.tar.gz
mkdir $PREFIX/info
mkdir $PREFIX/info/dir
mkdir $PREFIX/info/dir/dir
export PATH=$PATH:$PREFIX/bin
cd $DIR/binutils
rm -rf *
$DIR/binutils-2.17/configure --target=arm-elf --prefix=$PREFIX --enable-interwork --enable-multilib --with-float=soft --enable-languages="c,c++"
make -j2
make install
cd $DIR/gcc
rm -rf *
$DIR/gcc-4.1.1/configure --target=arm-elf --prefix=$PREFIX --enable-interwork --enable-multilib --with-float=soft --enable-languages="c,c++"
make -j2
make install
cd $DIR/newlib
rm -rf *
$PREFIX/newlib-1.14.0/configure --target=arm-elf --prefix=$PREFIX --enable-interwork --enable-multilib --with-float=soft
make -j2
make install
cd $DIR/gcc2
rm -rf *
$DIR/gcc-4.1.1/configure --target=arm-elf --prefix=$PREFIX --enable-interwork --enable-multilib --with-float=soft --enable-languages="c,c++" --with-newlib --with-headers=$PREFIX/newlib-1.14.0/newlib/libc/include
make -j2
make install
cd $DIR/gdb
rm -rf *
$DIR/gdb-6.6/configure --target=arm-elf --prefix=$PREFIX --enable-interwork --enable-multilib --with-float=soft
make -j2
make install
cd $DIR/insight
rm -rf *
$DIR/insight-6.6/configure --target=arm-elf --prefix=$PREFIX --enable-interwork --enable-multilib --with-float=soft
make -j2
make install
lpc21isp -term test10.hex /dev/ttyUSB0 38400 14746You can play with the baud rate. I chose the same baud rate I wedged into the test10.c file so that the -term option would provide readable output. The 14746 parameter is the speed of the crystal oscillator on the OLiMEX development board.
#daemon configuration
telnet_port 4444
gdb_port 3333
#interface
# JTAG protocol converter specification
interface parport
parport_port 0x378
parport_cable wiggler
jtag_speed 0
#use combined on interfaces or targets that can't set TRST/SRST separately
#reset_config trst_and_srst srst_pulls_trst
reset_config trst_and_srst separate
#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag_device 4 0x1 0xf 0xe
#target configuration
#target_script 0 reset h2294_init.script
daemon_startup reset
#target <type> <startup mode>
#target arm7tdmi <reset mode> <chainpos> <endianness> <variant>
target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4
run_and_halt_time 0 30
#target_script 0 reset oocd_flash2138.script
working_area 0 0x40000000 0x40000 nobackup
#flash configuration
flash bank lpc2000 0x0 0x40000 0 0 lpc2000_v1 0 14765 calc_checksum
# For more information about the configuration files, take a look at:
# http://openfacts.berlios.de/index-en.phtml?title=Open+On-Chip+Debugger
#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
(gdb) target remote localhost:3333(gdb)
monitor poll
bt
info all-registers