projects
/
fw
/
stlink
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c632f85
)
fix on stm32l4 to clear flash mass erase flags on CR
author
Bruno Dal Bo
<bruno.dalbo@hp.com>
Wed, 3 Feb 2016 21:06:18 +0000
(13:06 -0800)
committer
Bruno Dal Bo
<bruno.dalbo@hp.com>
Wed, 3 Feb 2016 21:06:18 +0000
(13:06 -0800)
src/stlink-common.c
patch
|
blob
|
history
diff --git
a/src/stlink-common.c
b/src/stlink-common.c
index 4ad28eef376397014130be2ae0562be4cac9f342..f2888d10b4a1ad1b072d83e96e39b7a6915dd66d 100644
(file)
--- a/
src/stlink-common.c
+++ b/
src/stlink-common.c
@@
-435,6
+435,8
@@
static inline void write_flash_cr_bker_pnb(stlink_t *sl, uint32_t n) {
uint32_t x = read_flash_cr(sl);
x &=~ STM32L4_FLASH_CR_OPBITS;
x &=~ STM32L4_FLASH_CR_PAGEMASK;
+ x &= ~(1<<STM32L4_FLASH_CR_MER1);
+ x &= ~(1<<STM32L4_FLASH_CR_MER2);
x |= (n << STM32L4_FLASH_CR_PNB);
x |= (1lu << STM32L4_FLASH_CR_PER);
#if DEBUG_FLASH