lpc2368 can't reset when using jtag_rclk

I got an Amontec JTAGKey 2 in order to use the adaptive clocking feature.

My target is an LPC2368 and I’m using the standard lpc2378.cfg supplied with OpenOCD-0.5.0.

It appears to work fine when in a fixed clock mode, but when I put it in adaptive clocking mode the reset command fails. Does anyone have any insight on this?

Open On-Chip Debugger
> halt
target state: halted
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0xa00000f3 pc: 0x7fffe154
> jtag_rclk 500
RCLK - adaptive
> reset
couldn't read enough bytes from FT2232 device (0 < 81)
couldn't read from FT2232
Trying to use configured scan chain anyway...
couldn't read enough bytes from FT2232 device (0 < 2)
couldn't read from FT2232
Bypassing JTAG setup events due to errors
...

Hi,

First make sure to use the last Amontec JTAGkey driver D2xx if your are running on windows and with d2xx support.

The last Amontec JTAGkey driver package is certified WHQL for any 32 bits and 64 bits Xp to win7…

http://www.amontec.com/jtagkey.shtml#drivers

You should try to enable the RTCK only after the RESET function.

Let me know .

Laurent

http://www.amontec.com

I’m using the LibUSB drivers supplied from Freddie Chopin’s compilation of OpenOCD-0.5.0. The FTDI drivers will not work with this. I suppose I could make my own compilation of OpenOCD, but I’d like to avoid that!

Errors after a reset when adaptive clocking is enabled:

> jtag_rclk
RCLK - adaptive
> reset
couldn't read enough bytes from FT2232 device (0 < 81)
couldn't read from FT2232
Trying to use configured scan chain anyway...
couldn't read enough bytes from FT2232 device (0 < 2)
couldn't read from FT2232
Bypassing JTAG setup events due to errors
couldn't read enough bytes from FT2232 device (0 < 6)
couldn't read from FT2232


in procedure 'reset'
couldn't read enough bytes from FT2232 device (0 < 6)
couldn't read from FT2232
Polling target failed, GDB will be halted. Polling again in 100ms
couldn't read enough bytes from FT2232 device (0 < 6)
couldn't read from FT2232
Polling target failed, GDB will be halted. Polling again in 300ms
couldn't read enough bytes from FT2232 device (0 < 6)
couldn't read from FT2232
Polling target failed, GDB will be halted. Polling again in 700ms

OK, I see where the problem is. There appears to be a configuration problem if jtag_rclk is called after adapter_khz. In other words, you can not switch from fixed clocking to adaptive clocking.

In my board configuration file I was using the “standard” target files for the lpc2xxx where adapter_khz is called. I would then issue the jtag_rclk command in my board.cfg file.

I changed it so adapter_khz is not called, only jtag_rclk, and the reset command now works.