I use openocd svn121, libftd2xx0.4.10 and an amontec jtagkey on a usb-2.0 port. With this , “mdh 0x80000000 102400” takes about 3 minutes and 40 seconds to transfer the 200 kbytes. That’s about 1kb/sec. openocd_preliminary_20060102.pdf suggests that speeds up to 6MHz should be possible with a ftdi chip. But I am far behind from such speeds. I wonder whether I have screwed something up. Any suggestions?
If your core is running at a reasonably fast clock (e.g. > 10 MHz), “arm7_9 fast_memory_access enable” should give you a huge speed increase.
If you’re not seeing any stability problems, you can further improve performance with the “verify_ir disable” command (only a few percent).
The “dump_binary” command is more suitable to evaluate speed, as it uses 32-bit accesses, while “mdh” uses half-word accesses. Disabling debug output (don’t run with -d, or run explicitly with -d2) also increases the speed, as the debug output to a terminal window puts quite some load on the system.
The FT2232 is generally able to achieve about 1.5 - 2 MHz effective download speed, due to USB roundtrip times, its on-chip buffer size, and the rather small packets required for debugging.
Reading from the target is going to be slower than writing, as the OpenOCD can assume that the target is always going to be able to catch up with everything the jtag interface sends, while it’s not guaranteed that the jtag interface is going to catch up with everything the target sends.
Dominic:
If your core is running at a reasonably fast clock (e.g. > 10 MHz), “arm7_9 fast_memory_access enable” should give you a huge speed increase.
This don't make a difference.
If you’re not seeing any stability problems, you can further improve performance with the “verify_ir disable” command (only a few percent).
Don't make a difference, too.
The “dump_binary” command is more suitable to evaluate speed, as it uses 32-bit accesses, while “mdh” uses half-word accesses.
Ah, this helps! With that I get 10 seconds regardless of the settings you mentioned above. I get the same 10 seconds with the mdw command.
This makes me curious: how comes mdw be 20 times as fast as mdh? While I could understand a factor of two, I completely fail to understand a factor of 20!
For every access to main memory, the core has to be synchronized back to system speed, and then debug state has to be reentered.
The ARM instruction set has the LDM/STM instruction that loads/stores multiple registers with a single access. The OpenOCD uses this to load/store up to 14 registers, greatly reducing the number of transitions to system speed and back.
arm7_9 fast_memory access should definitely make a difference (at least it does on the systems I’ve used), but maybe there are other factors that have a greater impact on your system.
The effect of verify_ir is very small - when writing to the target (load_binary command), it increases speed from about 115 to 120 kb/s, probably less.
Dominic:
For every access to main memory, the core has to be synchronized back to system speed, and then debug state has to be reentered.
The ARM instruction set has the LDM/STM instruction that loads/stores multiple registers with a single access. The OpenOCD uses this to load/store up to 14 registers, greatly reducing the number of transitions to system speed and back.
So with word accesses, up to 14 words are transferred in one transaction?