From: Uwe Bonnes Date: Fri, 20 Jan 2012 16:25:01 +0000 (+0100) Subject: F1 set_flash_cr_strt unconditionally set the PER bit and so mass erase didn't work X-Git-Url: https://git.gag.com/?p=fw%2Fstlink;a=commitdiff_plain;h=d00a6a30a2e020d629df2eec46840d6af247b607 F1 set_flash_cr_strt unconditionally set the PER bit and so mass erase didn't work --- 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) ); } }