eclipse debugger overwrite memory from 0x00000000

I’m trying to debug with eclipse, and debugger can’t stop at main(). When I download memory, I found that memory content changed since flashing memory.

Both with “load” and “monitor flash write_image main.bin” programmed the device succesfully, but later debugger rewrite it to

0x00000000 0x7fefffff SWI 0xefffff

0x00000004 0xffffffff UNDEFINED INSTRUCTION

0x00000008 0xfffffbff UNDEFINED INSTRUCTION

0x00000010 0xffffffdb UNDEFINED INSTRUCTION

0x00000014 0xdfffffff SWI 0xffffff

Trying with eclipse C/C++ GDB HW Debugger and Zylin embedded debugger as well

Same error on

  • ARM-ELF-GDB 6.8 and 7.0.1

  • OpenOCD 0.1.0 and 0.4.0-dev

I’m using

LPC2378

Olimex-arm-usb-ocd

OpenOCD 0.4.0-dev(0.1.0 tested as well)

ARM-ELF-GDB 6.8 (7.0.1 tested as well)

Eclipse with Zylin or GDB HW Debugger

Config files:

OpenOCD 0.1.0:


telnet_port 4444

gdb_port 3333

gdb_memory_map enable

gdb_flash_program enable

gdb_breakpoint_override hard

source [find tcl/interface/olimex-arm-usb-ocd.cfg]

source [find tcl/target/lpc2378.cfg]

OpenOCD 0.4.0-dev:


source [find tcl/interface/olimex-arm-usb-ocd.cfg]

source [find tcl/target/lpc2378.cfg]

telnet_port 4444

gdb_port 3333

tcl_port 6666

Debugger settings:


Initialize:


target remote localhost:3333

monitor halt

monitor sleep 500

load

Run command:


monitor soft_reset_halt

break main

continue

clear main

info breakpoints

OOCD log:


Open On-Chip Debugger 0.1.0 (2010-01-05-12:03) Release

BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS

$URL: https://kc8apf@svn.berlios.de/svnroot/r … /openocd.c $

force hard breakpoints

500 kHz

Info : JTAG tap: lpc2378.cpu tap/device found: 0x4f1f0f0f (Manufacturer: 0x787, Part: 0xf1f0, Version: 0x4)

Info : JTAG Tap/device matched

Warn : EmbeddedICE version 7 detected, EmbeddedICE handling might be broken

Warn : no tcl port specified, using default port 6666

Info : accepting ‘gdb’ connection from 0

Warn : acknowledgment received, but no packet pending

requesting target halt and executing a soft reset

target state: halted

target halted in ARM state due to breakpoint, current mode: Supervisor

cpsr: 0x800000d3 pc: 0x00000000

GDB log:


target remote localhost:3333

Vectors () at Common/src/Startup.S:124

124 LDR PC, PAbt_Addr

Current language: auto; currently asm

monitor halt

monitor sleep 500

load

Loading section .text, size 0xa28 lma 0x0

Loading section .data, size 0x4 lma 0xa28

Start address 0x0, load size 2604

Transfer rate: 2 KB/sec, 1302 bytes/write.

monitor soft_reset_halt

requesting target halt and executing a soft reset

target state: halted

target halted in ARM state due to breakpoint, current mode: Supervisor

cpsr: 0x800000d3 pc: 0x00000000

break main

Breakpoint 3 at 0x4ce: file main.c, line 84.

continue

Note: automatically using hardware breakpoints for read-only addresses.

(… NO BREAK → SEND halt FROM telnet …)

Program received signal SIGINT, Interrupt.

Vectors () at Common/src/Startup.S:122

122 LDR PC, Undef_Addr

info breakpoints

No breakpoints or watchpoints.

What could be a problem? I think it’s sime kind of software breakpoint, or another incorrect arm-elf-gdb instruction, which override memory.