aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorThomas Søhus <tls@ceepro.dk>2018-08-16 14:04:45 +0200
committerTomas Vanek <vanekt@fbl.cz>2018-09-19 05:37:33 +0100
commitb2d259f67cc3ee4b689e704228d97943bae94064 (patch)
tree6b591d9912dabee1d4faafaaad66f54a0c30c243 /doc
parent4423a58b4dd7e0e38d50886abd1bd09328c34e70 (diff)
downloadriscv-openocd-b2d259f67cc3ee4b689e704228d97943bae94064.zip
riscv-openocd-b2d259f67cc3ee4b689e704228d97943bae94064.tar.gz
riscv-openocd-b2d259f67cc3ee4b689e704228d97943bae94064.tar.bz2
Added support for STM32L4X option bytes writing.
Enables the programming of Write protection lock bits. - Updated/re-factored with option_read, option_write and option_load commands. Change-Id: I86358c7eb1285c3c0baac1564e46da8ced5fd025 Signed-off-by: Thomas Søhus <tls@ceepro.dk> Reviewed-on: http://openocd.zylin.com/4654 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Diffstat (limited to 'doc')
-rw-r--r--doc/openocd.texi36
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/openocd.texi b/doc/openocd.texi
index 1c005f2..e87d8c2 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -6596,6 +6596,42 @@ The @var{num} parameter is a value shown by @command{flash banks}.
Mass erases the entire stm32l4x device.
The @var{num} parameter is a value shown by @command{flash banks}.
@end deffn
+
+@deffn Command {stm32l4x option_read} num reg_offset
+Reads an option byte register from the stm32l4x device.
+The @var{num} parameter is a value shown by @command{flash banks}, @var{reg_offset}
+is the register offset of the Option byte to read.
+
+For example to read the FLASH_OPTR register:
+@example
+stm32l4x option_read 0 0x20
+# Option Register: <0x40022020> = 0xffeff8aa
+@end example
+
+The above example will read out the FLASH_OPTR register which contains the RDP
+option byte, Watchdog configuration, BOR level etc.
+@end deffn
+
+@deffn Command {stm32l4x option_write} num reg_offset reg_mask
+Write an option byte register of the stm32l4x device.
+The @var{num} parameter is a value shown by @command{flash banks}, @var{reg_offset}
+is the register offset of the Option byte to write, and @var{reg_mask} is the mask
+to apply when writing the register (only bits with a '1' will be touched).
+
+For example to write the WRP1AR option bytes:
+@example
+stm32l4x option_write 0 0x28 0x00FF0000 0x00FF00FF
+@end example
+
+The above example will write the WRP1AR option register configuring the Write protection
+Area A for bank 1. The above example set WRP1AR_END=255, WRP1AR_START=0.
+This will effectively write protect all sectors in flash bank 1.
+@end deffn
+
+@deffn Command {stm32l4x option_load} num
+Forces a re-load of the option byte registers. Will cause a reset of the device.
+The @var{num} parameter is a value shown by @command{flash banks}.
+@end deffn
@end deffn
@deffn {Flash Driver} str7x