Flashing LPC2148 with OpenOCD r1888

Hello.

I tried to flash LPC2148 using command:

“C:\Program Files\openocd-r1888\bin\openocd-ftd2xx.exe” -f jtagkey.cfg -c “flash write_image test.hex 0 ihex”

jtagkey.cfg is that one provided by Michael Fischer in mailing “Correct script to flash the lpc-2148” (http://lists.berlios.de/pipermail/openo … 07170.html) I just changed interface to Olimex and crystal to 12000

It ends up with such a problem:

30 kHz

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

Info : JTAG Tap/device matched

30 kHz

Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (Manufacturer: 0x787, Part: 0xf1f0, Version: 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: System

cpsr: 0x8000007f pc: 0x00003cde

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

Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1016). Workaround: increase “set remotetimeout” in GDB

Error: timed out while waiting for target halted

Warn : lpc2000 prepare sectors returned 10897328

Error: error writing to flash at address 0x00000000 at offset 0x00000000 (-902)

Please, can anybody suggest a solution?

Thank you

Dmitry

Hello Dmitry,

Try starting openocd in interactive mode (without the command). Then open a second “dos prompt” and telnet to openocd (telnet localhost 4444).

First issue the halt command, then enter your flash command. If that still fails, the output from that situation should give the experts here (not me!) something to sink their teeth into.

(If you get a timeout error waiting for the target to halt, you might try reducing the jtag speed in your .cfg file.)

-Hugh

Thank you, Hugh!

Things, you suggested gave the same negative result.

But I noticed, that programming works when I remove soft_reset_halt from “$_TARGETNAME configure -event reset-init” procedure!

But it reports errors in the beginning:

30 kHz

Error: JTAG communication failure, check connection, JTAG interface, target power etc.

Error: trying to validate configured JTAG chain anyway…

Error: unknown EmbeddedICE version (comms ctrl: 0x00000000)

30 kHz

Error: JTAG communication failure, check connection, JTAG interface, target power etc.

Error: trying to validate configured JTAG chain anyway…

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: System

cpsr: 0x2000007f pc: 0x00003aa0

1500 kHz

auto erase enabled

Info : Padding image section 0 with 1 bytes

wrote 16200 byte from file main.hex in 1.546875s (10.227273 kb/s)

verified 16199 bytes in 0.328125s

30 kHz

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

Info : JTAG Tap/device matched

Dmitry