From: Uwe Bonnes Date: Sun, 18 Dec 2011 14:21:26 +0000 (+0100) Subject: Fix a wrong placed brace and and a not replaced stlink_write_mem32() that keep X-Git-Url: https://git.gag.com/?p=fw%2Fstlink;a=commitdiff_plain;h=5652cee37d2742714c6cb54983718cf5891e5c80 Fix a wrong placed brace and and a not replaced stlink_write_mem32() that keep STM32L from programming --- diff --git a/src/stlink-common.c b/src/stlink-common.c index f89159a..74d03f5 100644 --- a/src/stlink-common.c +++ b/src/stlink-common.c @@ -1317,10 +1317,10 @@ int stlink_write_flash(stlink_t *sl, stm32_addr_t addr, uint8_t* base, unsigned } write_uint32((unsigned char*) &data, *(uint32_t*) (base + off)); - stlink_write_mem32(sl, addr + off, data); + stlink_write_debug32(sl, addr + off, data); /* wait for sr.busy to be cleared */ - while (stlink_read_debug32(sl, STM32L_FLASH_SR & (1 << 0)) != 0) { + while ((stlink_read_debug32(sl, STM32L_FLASH_SR) & (1 << 0)) != 0) { } #if 0 /* todo: check redo write operation */