flash: stm32f2/f4/f7: Add One-Time-Porgrammable (OTP) support 29/829/9
authorMoritz Fischer <moritz.fischer@ettus.com>
Mon, 21 Jan 2019 17:24:12 +0000 (09:24 -0800)
committerTomas Vanek <vanekt@fbl.cz>
Wed, 27 Feb 2019 00:16:50 +0000 (00:16 +0000)
commitf21c12abecb9df244f147740166378ede7ea398e
tree3b65180eeb7edf795c3a1ca0eb295e8f8984fa3d
parent2c76f1ac0e27c643539b604e23435f58fa0af016
flash: stm32f2/f4/f7: Add One-Time-Porgrammable (OTP) support

The OTP is part of the flash memory. It has 512 (1024 for F7) bytes
and is organized in 16 sectors with 32 (64 for F7) bytes each.
The OTP is exposed as separate flash bank 1 and can be used
with the usual flash commands.

Writing the OTP can be done as follows:

> stm32f2x otp 1 enable
> flash write bank 1 foo.bin 0
> mdw 0x1fff7800 4
> verify_image foo.bin 0x1fff7800
> stm32f2x otp 1 disable

Note: This patch is largely a rebase/cleanup of a patch
from 2012 by Laurent Charpentier and he did most of the work.

No new Clang-Analyzer warnings.

Change-Id: I5e6371f6a7c7a9929c1d7907d6ba4724f9d20d97
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Reviewed-on: http://openocd.zylin.com/829
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
doc/openocd.texi
src/flash/nor/stm32f2x.c
tcl/target/stm32f2x.cfg
tcl/target/stm32f4x.cfg
tcl/target/stm32f7x.cfg