flash/nor/nrf5: fix protection setting on nRF51
commitc97ccc8971b44fbce28438cb926990a6e5a63450
authorTomas Vanek <vanekt@fbl.cz>
Sun, 12 Apr 2020 08:15:00 +0000 (12 10:15 +0200)
committerTomas Vanek <vanekt@fbl.cz>
Wed, 28 Oct 2020 10:50:49 +0000 (28 10:50 +0000)
tree5006763a772fb32428b7dc6b1ea2c3484f5756c2
parent895d4a599585543155dd4a7559489cf126e02c4c
flash/nor/nrf5: fix protection setting on nRF51

Protection setting has not ever worked. UICR CLENR0 register cannot
be simply written but has to programmed because it resides in UICR
page of the flash.

Enable flash programming before writing CLENR0 and set back to r/o
afterwards.

Inform the user that reset might be required.

Change-Id: Ib0f96c74ba3583ac33f4394ddb57d8c8895adf53
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5586
Tested-by: jenkins
src/flash/nor/nrf5.c