Fix a wrong placed brace and and a not replaced stlink_write_mem32() that keep
authorUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Sun, 18 Dec 2011 14:21:26 +0000 (15:21 +0100)
committerUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Sun, 18 Dec 2011 14:33:05 +0000 (15:33 +0100)
STM32L from programming

src/stlink-common.c

index f89159a21c90bcea9eee6277c917702ae5f8ddc0..74d03f548c75e3a533e5e705d43e2a7569bb362b 100644 (file)
@@ -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 */