summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-12-27 11:34:31 -0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-12-27 11:34:31 -0800
commit155a6a2c0bacdd4752e944ffd579d441361883db (patch)
tree4aa42c95a50a6e9fe5a018d6532c5ec04eebc6ff /doc
parent84dbf8ab5a2e85c9d9c9d276fba152a45a441433 (diff)
downloadopenocd+libswd-155a6a2c0bacdd4752e944ffd579d441361883db.tar.gz
openocd+libswd-155a6a2c0bacdd4752e944ffd579d441361883db.tar.bz2
openocd+libswd-155a6a2c0bacdd4752e944ffd579d441361883db.tar.xz
openocd+libswd-155a6a2c0bacdd4752e944ffd579d441361883db.zip
NOR: make flash_write_unlock() pad to sector end
Resolve a regression when using newish automagic "write_image" modes, by always padding to the end of affected sectors. Also document some issues associated with those automagic options, in the User's Guide and also some related code comments. We might need similar padding at the *beginning* of some sectors, but this is a minimalist fix for the problems which have currently been reported (plus doc updates). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'doc')
-rw-r--r--doc/openocd.texi25
1 files changed, 23 insertions, 2 deletions
diff --git a/doc/openocd.texi b/doc/openocd.texi
index 1c20716c..154ecbca 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -3857,8 +3857,29 @@ explicitly as @option{bin} (binary), @option{ihex} (Intel hex),
The relevant flash sectors will be erased prior to programming
if the @option{erase} parameter is given. If @option{unlock} is
provided, then the flash banks are unlocked before erase and
-program. The flash bank to use is inferred from the @var{address} of
-each image segment.
+program. The flash bank to use is inferred from the address of
+each image section.
+
+@quotation Warning
+Be careful using the @option{erase} flag when the flash is holding
+data you want to preserve.
+Portions of the flash outside those described in the image's
+sections might be erased with no notice.
+@itemize
+@item
+When a section of the image being written does not fill out all the
+sectors it uses, the unwritten parts of those sectors are necessarily
+also erased, because sectors can't be partially erased.
+@item
+Data stored in sector "holes" between image sections are also affected.
+For example, "@command{flash write_image erase ...}" of an image with
+one byte at the beginning of a flash bank and one byte at the end
+erases the entire bank -- not just the two sectors being written.
+@end itemize
+Also, when flash protection is important, you must re-apply it after
+it has been removed by the @option{unlock} flag.
+@end quotation
+
@end deffn
@section Other Flash commands