EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Loading and Running LPC2103 with GDB/OpenOCD without Insight?

Started by rsturmer May 18, 2008
I'm working with an LPC2103 Olimex Dev kit with
GCC/OpenOCD/GDB/arm-elf-insight. I can get the part loaded up in
insight and kick off my program just fine, but want to "graduate" to
using just the GDB interface (insight is a lot of clutter for me, and I
prefer the console interace) I can't figure out though how to kick off
my program once I've got it loaded. Here's my session:

GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=arm-elf"...
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
0x7fffe278 in ?? ()
(gdb) load
Loading section .text, size 0xa80 lma 0x40000000
Start address 0x40000050, load size 2688
Transfer rate: 21504 bits/sec, 298 bytes/write.
(gdb) i p
Debugging a target over a serial line.
Program stopped at 0x7fffe278.
It stopped with signal SIGINT, Interrupt.
(gdb)
So what now? I can set the PC to 0x40000000 and kick it off, but that
doesn't work. I know this can work because insight does it for me, but
I don't know what the heck it's doing behind the scenes. Does anyone
else use this toolchain? What's the best way about things?

Cheers,

-R

An Engineer's Guide to the LPC2100 Series

Hi,

First you need to figure out entry address for your code.
>From the messages below looks like you are linking it
to run from SRAM so it could be 0x40000050.

Try

jump *0x40000050

If 0x40000050 does not work then you need to either check your
linker script or run under Insight and capture the GDB
commands.

Pawel

--- In l..., "rsturmer" wrote:
>
> I'm working with an LPC2103 Olimex Dev kit with
> GCC/OpenOCD/GDB/arm-elf-insight. I can get the part loaded up in
> insight and kick off my program just fine, but want to "graduate" to
> using just the GDB interface (insight is a lot of clutter for me,
and I
> prefer the console interace) I can't figure out though how to kick
off
> my program once I've got it loaded. Here's my session:
>
> GNU gdb 6.0
> Copyright 2003 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License,
and you
> are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for
> details.
> This GDB was configured as "--host=i686-pc-linux-gnu
> --target=arm-elf"...
> (gdb) target remote localhost:3333
> Remote debugging using localhost:3333
> 0x7fffe278 in ?? ()
> (gdb) load
> Loading section .text, size 0xa80 lma 0x40000000
> Start address 0x40000050, load size 2688
> Transfer rate: 21504 bits/sec, 298 bytes/write.
> (gdb) i p
> Debugging a target over a serial line.
> Program stopped at 0x7fffe278.
> It stopped with signal SIGINT, Interrupt.
> (gdb)
> So what now? I can set the PC to 0x40000000 and kick it off, but
that
> doesn't work. I know this can work because insight does it for me,
but
> I don't know what the heck it's doing behind the scenes. Does
anyone
> else use this toolchain? What's the best way about things?
>
> Cheers,
>
> -R
>

Trying that now.

How do I capture the gdb commands from insight?? That would be /enormously/ instructive!

Thanks!

-R

I'm working with an LPC2103 Olimex Dev kit with
>GCC/OpenOCD/GDB/arm-elf-insight. I can get the part loaded up in
>insight and kick off my program just fine, but want to "graduate" to
>using just the GDB interface (insight is a lot of clutter for me, and I
>prefer the console interace) I can't figure out though how to kick off
>my program once I've got it loaded. Here's my session:
>
>GNU gdb 6.0
>Copyright 2003 Free Software Foundation, Inc.
>GDB is free software, covered by the GNU General Public License, and you
>are
>welcome to change it and/or distribute copies of it under certain
>conditions.
>Type "show copying" to see the conditions.
>There is absolutely no warranty for GDB. Type "show warranty" for
>details.
>This GDB was configured as "--host=i686-pc-linux-gnu
>--target=arm-elf"...
>(gdb) target remote localhost:3333
>Remote debugging using localhost:3333
>0x7fffe278 in ?? ()
>(gdb) load
>Loading section .text, size 0xa80 lma 0x40000000
>Start address 0x40000050, load size 2688
>Transfer rate: 21504 bits/sec, 298 bytes/write.
>(gdb) i p
>Debugging a target over a serial line.
>Program stopped at 0x7fffe278.
>It stopped with signal SIGINT, Interrupt.
>(gdb)
>So what now? I can set the PC to 0x40000000 and kick it off, but that
>doesn't work. I know this can work because insight does it for me, but
>I don't know what the heck it's doing behind the scenes. Does anyone
>else use this toolchain? What's the best way about things?
>
>Cheers,
>
>-R
>
>


Memfault Beyond the Launch