flash/nor/stm32l: fix mass erase
authorPaul Fertser <fercerpav@gmail.com>
Fri, 23 Jan 2015 09:33:50 +0000 (12:33 +0300)
committerSpencer Oliver <spen@spen-soft.co.uk>
Wed, 4 Feb 2015 22:00:52 +0000 (22:00 +0000)
commitcd72808889e426d15c07949c8fcea50dc40fe393
treef17770d7949a1750ae4ac3ef4c9ea32c0d228489
parentc9639ae2acb5554c7b61cda2b4251b4e22223d8b
flash/nor/stm32l: fix mass erase

Topaz reports on http://sourceforge.net/p/openocd/tickets/87/ that
protection level constants are mixed up. This leads to device ending
up in protection level 1 after mass erase.

Additional work is required to actually put the device in RDP Level 1
and then back to Level 0, as Option bootloader launch is a special
kind of full target reset.

To be able to flash properly after mass_erase a "reset init" is needed
(it's anyway recommended to always perform it before any flash
operation).

Change-Id: I9a838909458039bb0114d3019723bf134fa4d7c9
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2490
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/flash/nor/stm32lx.c