On Mon, Oct 18, 2010 at 7:15 PM, Freddie Chopin <[email protected]> wrote:
> Hi!
>
> When I flash some big image (~128kB) on STM32 without any tricks:
>> reset halt
>> stm32x mass_erase
>> flash write_image c:\\stm32.hex
> I achieve speeds of 12kB. JTAG frequency is 1MHz.
>
> When I use my reset init script which sets the flash latency to 2 cycles,
> starts the PLL with internal RC oscillator (final chip frequency 64MHz) and
> sets JTAG frequency to 6MHz I achieve speeds of... 13.5kB/s...
>
> I've verified that this script works fine (the values in registers are
> fine), so why there is almost none increase in the loading speed?
>
> This test was caused by curiosity which started after reading one forum post
> in which someone describes that in CrossWorks when using the same JTAG he
> achieved almost 150kB/s, over 14x faster than OpenOCD.

Well, that's BS. The STM32 flash has a nominal programming time of
52.5µs per 16 bits. So the theoretical max speed anyone can achieve is
roughly 37.2 KiBytes/s. If you see claims of speeds way above that
they're either lies, load-to-ram figures or a mixup in units.

That said, I think it should be possible to crank up the STM32 flash
programming speed in OpenOCD by at least a factor of two. I don't know
what the bottleneck is, but like you I have concluded that JTAG
frequency is not the major issue here. My guess is that the
programming algorithm we use might be quite inefficient. USB latency
might play a role but with double buffering and other tricks in the
algorithm the latency shouldn't be a limiting factor.

/Andreas
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to