Make it easier to erase or protect through to the end

of a (NOR) flash chip: allow passing "last" as an alias
for the number of the last sector.

Improve several aspects of error checking while we're at it.

From: Johnny Halfmoon <jhalfmoon@milksnot.com>


git-svn-id: svn://svn.berlios.de/openocd/trunk@2746 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
dbrownell
2009-09-22 05:39:06 +00:00
parent 6cba486356
commit 50b94628ae
2 changed files with 99 additions and 54 deletions

View File

@@ -3187,8 +3187,11 @@ and AT91SAM7 on-chip flash.
@anchor{flash erase_sector}
@deffn Command {flash erase_sector} num first last
Erase sectors in bank @var{num}, starting at sector @var{first} up to and including
@var{last}. Sector numbering starts at 0.
Erase sectors in bank @var{num}, starting at sector @var{first}
up to and including @var{last}.
Sector numbering starts at 0.
Providing a @var{last} sector of @option{last}
specifies "to the end of the flash bank".
The @var{num} parameter is a value shown by @command{flash banks}.
@end deffn
@@ -3247,7 +3250,7 @@ and display that status.
The @var{num} parameter is a value shown by @command{flash banks}.
This is the only operation that
updates the erase state information displayed by @option{flash info}. That means you have
to issue an @command{flash erase_check} command after erasing or programming the device
to issue a @command{flash erase_check} command after erasing or programming the device
to get updated information.
(Code execution may have invalidated any state records kept by OpenOCD.)
@end deffn
@@ -3259,9 +3262,12 @@ The information includes per-sector protect status.
@end deffn
@anchor{flash protect}
@deffn Command {flash protect} num first last (on|off)
Enable (@var{on}) or disable (@var{off}) protection of flash sectors
@var{first} to @var{last} of flash bank @var{num}.
@deffn Command {flash protect} num first last (@option{on}|@option{off})
Enable (@option{on}) or disable (@option{off}) protection of flash sectors
in flash bank @var{num}, starting at sector @var{first}
and continuing up to and including @var{last}.
Providing a @var{last} sector of @option{last}
specifies "to the end of the flash bank".
The @var{num} parameter is a value shown by @command{flash banks}.
@end deffn