I have a problem with OpenOCD and GDB. Debugging works fine if I erase at least the first sector of the lpc2148 – I use telnet for that (flash_erase_sector 0 0 0). So if I start a debugging session in Eclipse everything works fine. But if I stop the session and try to restart a new one I get this error.
Open On-Chip Debugger 0.3.0-in-development (2009-08-19-10:19) svn:2596
$URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $
For bug reports, read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS
30 kHz
jtag_nsrst_delay: 200
jtag_ntrst_delay: 200
Info : device: 4 "2232C"
Info : deviceID: 67358712
Info : SerialNumber: 32OZPDQCA
Info : Description: Amontec JTAGkey A
Info : clock speed 30 kHz
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
Info : JTAG Tap/device matched
target state: halted
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0x60000093 pc: 0x40000070
30 kHz
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
Info : JTAG Tap/device matched
Warn : srst pulls trst - can not reset into halted mode. Issuing halt after reset.
target state: halted
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0xa00000f3 pc: 0x7fffd2c2
requesting target halt and executing a soft reset
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0xa00000d3 pc: 0x00000000
1500 kHz
Info : accepting 'gdb' connection from 0
Warn : acknowledgment received, but no packet pending
background polling: on
TAP: lpc2148.cpu (enabled)
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0xa00000d3 pc: 0x00000000
requesting target halt and executing a soft reset
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0xa00000d3 pc: 0x00000000
30 kHz
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
Info : JTAG Tap/device matched
Warn : srst pulls trst - can not reset into halted mode. Issuing halt after reset.
target state: halted
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0xa00000f3 pc: 0x7fffd2c0
requesting target halt and executing a soft reset
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0xa00000d3 pc: 0x00000000
1500 kHz
0xe01fc040: 00000001
flash 'lpc2000' found at 0x00000000
Warn : Verification will fail since checksum in image (0xe1a00000) to be written to flash is different from calculated vector checksum (0xa1b11eac).
Warn : To remove this warning modify build tools on developer PC to inject correct LPC vector checksum.
Info : dropped 'gdb' connection - error -400
Info : accepting 'gdb' connection from 0
Warn : acknowledgment received, but no packet pending
background polling: on
TAP: lpc2148.cpu (enabled)
target state: halted
target halted in ARM state due to debug-request, current mode: System
cpsr: 0x8000001f pc: 0x00000320
requesting target halt and executing a soft reset
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x800000d3 pc: 0x00000000
30 kHz
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
Info : JTAG Tap/device matched
Warn : srst pulls trst - can not reset into halted mode. Issuing halt after reset.
target state: halted
target halted in ARM state due to debug-request, current mode: System
cpsr: 0x8000001f pc: 0x00000310
requesting target halt and executing a soft reset
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x800000d3 pc: 0x00000000
1500 kHz
0xe01fc040: 00000001
flash 'lpc2000' found at 0x00000000
Error: timed out while waiting for target halted
Warn : target not halted
Error: Target not halted
Error: error writing to flash at address 0x00000000 at offset 0x00000000 (-304)
Warn : target not halted
Info : can't add breakpoint while target is running (BPID: 13)
Warn : target not halted
Warn : target not halted
Eclipse Dialog:
Execution is suspended because of error.
Warning:
Cannot insert hardware breakpoint 1.
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.
As recently as I erase at least the first sector of the on chip flash via telnet it works fine again. Sometimes I must halt the target before the erase command works.
I use the latest Version of OpenOCD with FTDI-Lib and the latest Eclipse and Zylin tools.
These are my gdb init commands:
target remote localhost:3333
monitor poll
monitor reset init
monitor sleep 500
monitor mww 0xE01FC040 0x0001
monitor mdw 0xE01FC040
# needed for gdb 6.8 and higher
set mem inaccessible-by-default off
monitor flash probe 0
load
break main
continue
I do not know what´s wrong.
thanks mgiaco