Hi Bohdan,
The PSoC4 autoerase trick is a must as PSoC4 does not implement row
erase - only mass erase is available.
In principle it is possible to use /flash_bank->sectors[i]->is_erased
/The problem is how to keep flags in sync when user firmware programs or
erases the flash.
Therefore most drivers do not rely on is_erased state. The flag is set
in erase_check method (usually
default_flash_mem_blank_check()) and in turn showed by
handle_flash_erase_check_command()
So if you want, ensure is_erased is kept in sync during flash
erase/write and use it.
Maybe add an option forcing fallback to standard behavior.
BTW If you care about flashing speed, I feel calling
target_run_algorithm() for every block
is suboptimal (Note in time of I wrote PSoC4 driver there was biggest
device with 32 kByte flash).
Faster solution would be to use target_run_flash_async_algorithm() instead
and move all IPC stuff to algorithm running on target.
IMHO I recommend you to finish the existing basic version (not lighting
fast but working).
As soon as it is merged you may submit one or more changes to improve it.
Thanks for the kit.
Tom
On 11.11.2017 16:07, Bohdan Tymkiv wrote:
I am trying to improve flash programming speed. Main reason of
slowness is that for each Flash Row we have to call either
1) ERASE_ROW+PROGRAM_ROW, which is ~2x slower than PROGRAM_ROW itself, or
2) WRITE_ROW, which is ~1.5x slower
I looked at psoc4 flash_autoerase [on/off] trick (use either
WRITE_ROW, or mass_erase + PROGRAM_ROW).
The downside of this trick is that user does not have ability to erase
individual rows via telnet or gdb qRcmd commands.
My question is,
is it OK to keep cached state of each row somewhere in
/bank->driver_priv/ and skip erase operation for rows which are marked
as erased?
E.g. mark corresponding rows as /erased/ in psoc6_erase, mark rows as
/not erased /in psoc6_program, etc...
This allows to skip expensive erase operations if, for instance,
/psoc6 mass_erase/ has already been issued by the user.
/flash_bank->sectors/ structures already have something
similar/ (//flash_bank->sectors[i]->is_erased), /but these flags are
always set to zero when psoc6_erase is entered (and I can not find the
location where they are cleared) so they can not be used for this purpose.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel