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
...
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.