From d00a6a30a2e020d629df2eec46840d6af247b607 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Fri, 20 Jan 2012 17:25:01 +0100 Subject: [PATCH] F1 set_flash_cr_strt unconditionally set the PER bit and so mass erase didn't work --- src/stlink-common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stlink-common.c b/src/stlink-common.c index 39a714b..b6e4a51 100644 --- a/src/stlink-common.c +++ b/src/stlink-common.c @@ -246,9 +246,9 @@ static void set_flash_cr_strt(stlink_t *sl) { stlink_write_debug32(sl, FLASH_F4_CR, x); } else { - /* assume come on the flash_cr_per path */ - const uint32_t n = (1 << FLASH_CR_PER) | (1 << FLASH_CR_STRT); - stlink_write_debug32(sl, FLASH_CR, n); + stlink_write_debug32( + sl, FLASH_CR, + stlink_read_debug32(sl,FLASH_CR) |(1 << FLASH_CR_STRT) ); } } -- 2.30.2