EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Debug problems on LPC2138 with OpenOCD (newbie)

Started by bmueller38 August 10, 2006
Hi everybody,

I am currently trying to get my first microcontroller-project running.
I use a LPC2138 Board from Olimex and the software according to the
great tutorial of Jim Lynch. My Wiggler is self-soldered.

When I try to debug my program with OpenOCD in Eclise, I get the
following output:

Warning: arm7_9_common.c:741 arm7_9_halt(): target was already halted
Info: server.c:62 add_connection(): accepted 'gdb' connection from 0
Error: arm7_9_common.c:1628 arm7_9_read_memory(): memory read caused
data abort
Warning: arm7_9_common.c:89 arm7_9_set_breakpoint(): breakpoint
already set
Warning: arm7_9_common.c:89 arm7_9_set_breakpoint(): breakpoint
already set

... (one warning for every step)

Warning: arm7_9_common.c:89 arm7_9_set_breakpoint(): breakpoint
already set
Error: armv4_5.c:180 armv4_5_mode_to_number(): invalid mode value
encountered
Error: arm7_9_common.c:867 arm7_9_debug_entry(): cpsr contains
invalid mode value - communication failure
Warning: arm7_9_common.c:80 arm7_9_set_breakpoint(): target not halted
Error: gdb_server.c:515 gdb_get_register_packet(): gdb requested
registers, but we're not halted

Can anybody please help me?

Thanks

An Engineer's Guide to the LPC2100 Series

Hi,

please send the configuration file you used and a OpenOCD debug log (run
with -d -l ) to Dominic.Rath gmx.de.

What version of the OpenOCD and which toolchain did you use?

Regards,

Dominic

On Thursday 10 August 2006 15:53, bmueller38 wrote:
> Hi everybody,
>
> I am currently trying to get my first microcontroller-project running.
> I use a LPC2138 Board from Olimex and the software according to the
> great tutorial of Jim Lynch. My Wiggler is self-soldered.
>
> When I try to debug my program with OpenOCD in Eclise, I get the
> following output:
>
> Warning: arm7_9_common.c:741 arm7_9_halt(): target was already halted
> Info: server.c:62 add_connection(): accepted 'gdb' connection from 0
> Error: arm7_9_common.c:1628 arm7_9_read_memory(): memory read caused
> data abort
> Warning: arm7_9_common.c:89 arm7_9_set_breakpoint(): breakpoint
> already set
> Warning: arm7_9_common.c:89 arm7_9_set_breakpoint(): breakpoint
> already set
>
> ... (one warning for every step)
>
> Warning: arm7_9_common.c:89 arm7_9_set_breakpoint(): breakpoint
> already set
> Error: armv4_5.c:180 armv4_5_mode_to_number(): invalid mode value
> encountered
> Error: arm7_9_common.c:867 arm7_9_debug_entry(): cpsr contains
> invalid mode value - communication failure
> Warning: arm7_9_common.c:80 arm7_9_set_breakpoint(): target not halted
> Error: gdb_server.c:515 gdb_get_register_packet(): gdb requested
> registers, but we're not halted
>
> Can anybody please help me?
>
> Thanks
On Thu, 10 Aug 2006 16:07:24 +0200
in <2...@gmx.de>,
Dominic Rath wrote:

> please send the configuration file you used and a OpenOCD debug log
> ...

and please post some good configuration/script files!

clemens
Hi,

it seems as if it would work now...
I am now using OpenOCD Version re82 from www.yagarto.de.
As executable, I choose openocd-pp.exe and as configfile lpc2xxx_pp.cfg.

There are still some strange warnings, but debugging works.

Thanks a lot to Dominic!
On Tue, 15 Aug 2006 09:38:20 -0000 bmueller38 wrote:

> As executable, I choose openocd-pp.exe and as configfile lpc2xxx_pp.cfg.

could you please post your config file, together with LPC2000 variant
and debug-setup?

is there a complete reference of openocd configuration settings
anywhere?
clemens
> > As executable, I choose openocd-pp.exe and as configfile
lpc2xxx_pp.cfg.
>
> could you please post your config file, together with LPC2000 variant
> and debug-setup?
>
> is there a complete reference of openocd configuration settings
> anywhere?
Hi,

first the content of my config-file:

#daemon configuration
telnet_port 4444
gdb_port 3333

#interface
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

#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
#target arm7tdmi
target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4
run_and_halt_time 0 30

#flash configuration
#flash bank lpc2000 0x0 0x40000 0 0 lpc2000_v1 0 14765 calc_checksum

I am using a LPC2138 Board from Olimex. My debugger is arm-elf-gdb.exe
with the following commands:

target remote localhost:3333
monitor soft_reset_halt
monitor arm7_9 force_hw_bkpts enable
symbol-file main.out
thbreak main
continue

I hope this answered to your question!?

bjoern
On Thu, 10 Aug 2006 13:53:01 -0000 bmueller38 wrote:

> When I try to debug my program with OpenOCD in Eclise, I get the
> following output:
>
> Warning: arm7_9_common.c:741 arm7_9_halt(): target was already halted
> Info: server.c:62 add_connection(): accepted 'gdb' connection from 0
> Error: arm7_9_common.c:1628 arm7_9_read_memory(): memory read caused
> data abort
> Warning: arm7_9_common.c:89 arm7_9_set_breakpoint(): breakpoint
> already set

i can only tell from what insight shows on its configuration screen: the
breakpoint at main() might already be set in some internal startup.

yours is:

target remote localhost:3333
monitor soft_reset_halt
monitor arm7_9 force_hw_bkpts enable
symbol-file main.out
thbreak main
continue

you're setting a breakpoint at main() there. other than that your
configuration is about the same as mine. i occasionally get the "data
abort", but i don't know why.

> Error: arm7_9_common.c:867 arm7_9_debug_entry(): cpsr contains
> invalid mode value - communication failure

... and the "cpsr invalid" as well. i think earlier versions < 62
didn't behave like that so often, but i don't have logs left.

i wonder if gdb has any knowledge of things happening behind its back
when using "monitor" commands. it might if it analyzes the changing
register values, but i don't think so. could it be that the "monitor
soft_reset_halt" changes the targets state confusing gdbs point of view?

i try to avoid monitor commands like resetting in the middle of things
because of that.

regards,

clemens

The 2024 Embedded Online Conference