From 86ed86c2a24d601546c0dc47035a033b0b4767b2 Mon Sep 17 00:00:00 2001 From: Jeremy Elson Date: Sun, 24 Feb 2019 17:42:09 -0800 Subject: [PATCH] Use 32-bit variable for 32-bit read. (Also fixes DEBUG compile error due to mismatch of format and argument.) --- src/target/stm32f1.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/target/stm32f1.c b/src/target/stm32f1.c index e0802493..1c7f4ffa 100644 --- a/src/target/stm32f1.c +++ b/src/target/stm32f1.c @@ -188,7 +188,6 @@ static int stm32f1_flash_erase(struct target_flash *f, target_addr addr, size_t len) { target *t = f->t; - uint16_t sr; stm32f1_flash_unlock(t); @@ -212,7 +211,7 @@ static int stm32f1_flash_erase(struct target_flash *f, } /* Check for error */ - sr = target_mem_read32(t, FLASH_SR); + uint32_t sr = target_mem_read32(t, FLASH_SR); if ((sr & SR_ERROR_MASK) || !(sr & SR_EOP)) { DEBUG("stm32f1 flash erase error 0x%" PRIx32 "\n", sr); return -1;