OpenOCD with Olimex ARM-USB-OCD and LPC1768 - Error: JTAG-DP

Hello,

I tried a lot of hours to fix my problems, reading much sites and hints but nothing works for me.

Used Hardware/Software:

  • Olimex ARM-USB-OCD

  • PCB with LPC1768, some components for 3.3V DC and the JTAG-Interface

  • Drivers from olimex.com (libusb-1.2.2.0, CDM20808)

  • OpenOCD 0.4.0, a fresh Yagarto, Eclipse (not yet)

To find the right cfg-files is easy, here is my command:

openocd-libftdi.exe -f olimex-arm-usb-ocd.cfg -f tcl\target\lpc1768.cfg

But I’ve got tons of errors. All above 20kHz floods the Console. I reduced to 10 kHz and connected with second console (sending a “halt; flash info 0”) and after that with arm-none-eabi-gdb.exe (sending “monitor reset halt”), here are the messages:

C:\OpenOCD>openocd-libftdi.exe
Open On-Chip Debugger 0.4.0 (2010-11-23-14:20)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.berlios.de/doc/doxygen/bugs.html
jtag_nsrst_delay: 200
jtag_ntrst_delay: 200
trst_and_srst srst_pulls_trst srst_gates_jtag trst_push_pull srst_open_drain
10 kHz
Info : clock speed 10 kHz
Info : JTAG tap: lpc1768.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xb
a00, ver: 0x4)
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
Error: MEM_AP_CSW 0x23000052, MEM_AP_TAR 0x4
Info : lpc1768.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe0001004
Info : accepting 'telnet' connection from 0
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe0001004
Warn : target was in unknown state when halt was requested
Info : Halt timed out, wake up GDB.
Error: timed out while waiting for target halted
Command handler execution failed
Info : dropped 'telnet' connection - error -400
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0xe0001004
Info : accepting 'gdb' connection from 0
Warn : acknowledgment received, but no packet pending
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
Error: MEM_AP_CSW 0x23000052, MEM_AP_TAR 0xe0001004
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0x4
Info : JTAG tap: lpc1768.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xb
a00, ver: 0x4)
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed
Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0x4
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x23000042, MEM_AP_TAR 0x4
Error: can't request a halt while in reset if nSRST pulls nTRST
Command handler execution failed

OpenOCD finds the device (marked green), but only with max 10 kHz - above that I only get tons of error-messages. With 10 kHz or below I can’t do anything, errors are allways as in above log.

What’s wrong, what could I do? :roll:

ok - because nobody gives a hint a had to try it again today.

With 1 kHz I could start OpenOCD without errors. Sometimes up to 8 kHz are possible, but this is not stable: One time it works, the next minute it won’t.

But so it was possible to test some more things in the OpenOCD-Console. This way I figured out, that it’s necessary to change a parameter in lpc1768.cfg if you use an olimex … The Olimex ARM-USB-OCD has no nSRST in the adapter ( http://olimex.com/dev/images/arm-jtag-layout.gif ) so you can’t use srst_pulls_trst for reset. The related line in cfg must be changed to:

reset_config trst_and_srst

Now I can flash my programs from the OpenOCD-Console with:

reset halt

flash write_image erase sample.bin

With the reset halt I have same problems as above: sometimes the halt is possible with 8 kHz, often only 1kHz works. Above 8 kHz I got lots of errors, same as in the first post of this thread. At least I was able to change the speed after halt, so I can flash with jtag_khz up to 1.2 MHz (ca. 20s with a 98k-bin-file). Debugging is still impossible, but for now I can abandon this.

I hope, I could help other people with same problem :slight_smile: