second time debug "target not halted"

Hi,

I am facing this issue with GDB-LPC2148-openocd0.4.0 combination. I am using turtle interface.

My gdb init commands are

target remote localhost:3333

monitor reset halt

load

The LPC2148 enters debug mode and I am able to debug the code without any problems.

However when I restart the debugging, the target does not halt and I get a warning “target not halted”. Consequently, I am not able to debug the code.

If I power cycle (power off and then power on) the board, then everything goes back to normal and I am able to debug.

I have to power cycle the board every time I want to start debugging.

Please let me know if anyone faced this issue and found any solution.

Note: I have tried using monitor soft_reset_halt but that did not help.

Thanks and Regards,

Anant

The console output on openocd prompt is given below

pen On-Chip Debugger 0.4.0 (2011-10-13-19:31)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.berlios.de/doc/doxygen/bugs.html

RCLK - adaptive

jtag_nsrst_delay: 200

jtag_ntrst_delay: 200

trst_and_srst srst_pulls_trst srst_gates_jtag trst_push_pull srst_open_drain

Info : device: 4 “2232C”

Info : deviceID: 67354056

Info : SerialNumber: FTULILUMA

Info : Description: test device

Info : RCLK (adaptive clock speed) not supported - fallback to 500 kHz

Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)

Info : Embedded ICE version 4

Info : lpc2148.cpu: hardware has 2 breakpoint/watchpoint units

Info : accepting ‘gdb’ connection from 0

Warn : acknowledgment received, but no packet pending

undefined debug reason 6 - target needs reset

Warn : target not halted

Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)

Warn : srst pulls trst - can not reset into halted mode. Issuing halt after reset.

Info : Halt timed out, wake up GDB.

Error: timed out while waiting for target halted

TARGET: lpc2148.cpu - Not halted

Command handler execution failed

Error: Target not halted

Error: failed erasing sectors 0 to 0 (-304)

Error: flash_erase returned -304

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

Warn : target not halted

I am a relatively new user to the openocd tools, so I will not claim to be an expert.

I added some text to my board/xxx.cfg file to halt the micro;

after the interface and target .cfg files are run;

init

echo “Command mode”

halt

The ‘init’ puts the thing in command mode, to allow typing commands like in telnet. Thus, everytime I run the

batch file that calls the setup, it halts automatically.

Hello Hardwareguy,

I am able to halt only for the first time after power up. The second time onwards after I end the first debug session, I encounter this problem. The target processor does not halt when I try to launch debugger the second time.

–Anant

If you use a telnet connection to openocd, are you able to type “halt”?

(telnet localhost 4444, at DOS promt)

If so , does it halt? what does it respond with

you can also do a number of commands from there; such as “poll”.