There are several settings that help increase the download speed:
The FT2232 driver used
At compile time, you have to select which FT2232 driver library to use, either FTDI’s proprietary FTD2XX or the open-source libftdi. FTD2XX offers a huge performance gain at the cost of being not completely free (it’s gratis, but not free software). Which driver were you using?
jtag_speed
This should be set to the lowest value that still allows proper communication. For a FT2232 based interface (like the JTAGkey), the resulting frequency is 6MHz / (1 + divisor). If your target (what is it?) is a -S core (e.g. ARM7TDMI-S), the JTAG frequency must be less than 1/6th of the current processor frequency. With a good board layout and a JTAG cable that isn’t too long (~10cm are usually best) you should be able to use “jtag_speed 0” on non “-S” cores.
arm7_9 fast_memory_access <‘enable’|‘disable’>
Fast memory access allows the OpenOCD to pretend that the target is always fast enough to catch up with memory accesses, reducing the number of readbacks from the target. This gives a huge speed increase but could result in communication failures if the target’s clock speed is less than the JTAG frequency. This should work fine, especially if you enable it after switching an on-chip PLL on.
arm7_9 dcc_downloads <‘enable’|‘disable’>
Together with fast_memory_access this offers the highest possible speed. It requires a “working_area” to be specified that is used to hold an on-chip algorithm for the DCC communication. For DCC operation, a few byte (24 or more) somewhere in your target’s RAM are enough. This location must NOT be written to with a load_binary operation and must not be modified with mw[bhw] commands. DCC operation requires a processor clock that is at least the same as the JTAG frequency.
you could enable the DEBUG_USB_IO macro in ft2232.c to measure the time the USB requests take to complete. Enabling fast_memory_access should cause the number of transactions to drop significantly (less calls to jtag_execute_queue).
As I don’t know your particular core nor the changes you’ve made to the OpenOCD I can’t tell you why you’re not seeing the expected speed increase.
I’ve read somewhere that using an USB 2.0 HUB on an USB 2.0 port increases FT2232 performance, but I haven’t observed that myself.
DCC downloads require a working_area to be specified:
The arm7_9 fast_memory_access <‘enable’|‘disable’> should provide a huge difference.
@ Dominic,
We have to think to add a new OpenOCD option allowing to add a RUNTEST in IDLE JTAG Tap State for x Clocks pulses when arm7_9 fast_memory_access enable. In this case we could wait/add a specific time between memory access. This will help to adjust and remove the communication failures. A bit specific, but this will really help.