Hi,
First of all: thanks for a great tool!
I’m using an Olimex LPC-H2148 with an Olimex JTAG (wiggler compatible).
I have a small program blinking the LED that I run from flash memory.
I program the flash using OpenOCD from inside GDB:
(gdb) target remote 127.0.0.1:3333
(gdb) monitor flash erase 0 0 26
erased sectors 0 through 26 on flash bank 0 in 0s 164835us
(gdb) monitor flash erase_check 0
successfully checked erase state
(gdb) monitor flash info 0
#1: lpc2000 at 0x00000000, size 0x0007d000, buswidth 0, chipwidth 0
#0: 0x00000000 (0x1000kB) erased, protected
#1: 0x00001000 (0x1000kB) erased, protected
#2: 0x00002000 (0x1000kB) erased, protected
#3: 0x00003000 (0x1000kB) erased, protected
#4: 0x00004000 (0x1000kB) erased, protected
#5: 0x00005000 (0x1000kB) erased, protected
#6: 0x00006000 (0x1000kB) erased, protected
#7: 0x00007000 (0x1000kB) erased, protected
#8: 0x00008000 (0x8000kB) erased, protected
#9: 0x00010000 (0x8000kB) erased, protected
#10: 0x00018000 (0x8000kB) erased, protected
#11: 0x00020000 (0x8000kB) erased, protected
#12: 0x00028000 (0x8000kB) erased, protected
#13: 0x00030000 (0x8000kB) erased, protected
#14: 0x00038000 (0x8000kB) erased, protected
#15: 0x00040000 (0x8000kB) erased, protected
#16: 0x00048000 (0x8000kB) erased, protected
#17: 0x00050000 (0x8000kB) erased, protected
#18: 0x00058000 (0x8000kB) erased, protected
#19: 0x00060000 (0x8000kB) erased, protected
#20: 0x00068000 (0x8000kB) erased, protected
#21: 0x00070000 (0x8000kB) erased, protected
#22: 0x00078000 (0x1000kB) erased, protected
#23: 0x00079000 (0x1000kB) erased, protected
#24: 0x0007a000 (0x1000kB) erased, protected
#25: 0x0007b000 (0x1000kB) erased, protected
#26: 0x0007c000 (0x1000kB) erased, protected
lpc2000 flash driver variant: 2, clk: 12000
(gdb) monitor flash write 0 <path/to/binary> 0x0
wrote file <path/to/binary> to flash bank 0 at offset 0x00000000 in 1s 418831us
(gdb) monitor reset
(gdb) c
Continuing.
Then the program runs ok.
While running, OpenOCD (-d 3) outputs these messages (at a constant rate approx 5 times per second):
Debug: embeddedice.c:203 embeddedice_read_reg_w_check(): 1
Debug: embeddedice.c:203 embeddedice_read_reg_w_check(): 1
…
But after a while (usually 5-30 minutes) OpenOCD exits with the following message:
Debug: embeddedice.c:203 embeddedice_read_reg_w_check(): 1
Debug: embeddedice.c:203 embeddedice_read_reg_w_check(): 1
Debug: embeddedice.c:203 embeddedice_read_reg_w_check(): 1
Debug: arm7_9_common.c:620 arm7_9_poll(): DBGACK set, dbg_state->value: 0x4f1f0f0f
Debug: embeddedice.c:299 embeddedice_write_reg(): 0: 0x00000005
Debug: embeddedice.c:299 embeddedice_write_reg(): 12: 0x00000000
Debug: arm7_9_common.c:944 arm7_9_debug_entry(): target entered debug from ARM state
Error: armv4_5.c:186 armv4_5_mode_to_number(): invalid mode value encountered
Error: arm7_9_common.c:972 arm7_9_debug_entry(): cpsr contains invalid mode value - communication failure
Error: target.c:1056 handle_target(): couldn’t poll target, exiting
Is my JTAG broken (or maybe the parallel port I’m using)?
I have tried with different versions of OpenOCD (including svn -r128 and the latest) all with the same result.
Any suggestions much appreciated.
Best regards,
Peter