Merge pull request #449 from jelson/width-fix
Use 32-bit variable for 32-bit read
This commit is contained in:
commit
da62cbaa3d
@ -188,7 +188,6 @@ static int stm32f1_flash_erase(struct target_flash *f,
|
|||||||
target_addr addr, size_t len)
|
target_addr addr, size_t len)
|
||||||
{
|
{
|
||||||
target *t = f->t;
|
target *t = f->t;
|
||||||
uint16_t sr;
|
|
||||||
|
|
||||||
stm32f1_flash_unlock(t);
|
stm32f1_flash_unlock(t);
|
||||||
|
|
||||||
@ -212,7 +211,7 @@ static int stm32f1_flash_erase(struct target_flash *f,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check for error */
|
/* 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)) {
|
if ((sr & SR_ERROR_MASK) || !(sr & SR_EOP)) {
|
||||||
DEBUG("stm32f1 flash erase error 0x%" PRIx32 "\n", sr);
|
DEBUG("stm32f1 flash erase error 0x%" PRIx32 "\n", sr);
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user