flash: stm32f1x: add a couple missing stm32x_get_flash_reg

Change-Id: I163de2c1bd962e7ea9ca6c741c1c62224c210677
Signed-off-by: Szymon Modzelewski <szmodzelewski@gmail.com>
Reviewed-on: http://openocd.zylin.com/486
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
Szymon Modzelewski 2012-02-25 06:10:04 +01:00 committed by Spencer Oliver
parent 5c5af2467b
commit 27b3d9c434
1 changed files with 3 additions and 3 deletions

View File

@ -701,13 +701,13 @@ static int stm32x_write_block(struct flash_bank *bank, uint8_t *buffer,
if (buf_get_u32(reg_params[0].value, 0, 32) & FLASH_PGERR) {
LOG_ERROR("flash memory not erased before writing");
/* Clear but report errors */
target_write_u32(target, STM32_FLASH_SR_B0, FLASH_PGERR);
target_write_u32(target, stm32x_get_flash_reg(bank, STM32_FLASH_SR), FLASH_PGERR);
}
if (buf_get_u32(reg_params[0].value, 0, 32) & FLASH_WRPRTERR) {
LOG_ERROR("flash memory write protected");
/* Clear but report errors */
target_write_u32(target, STM32_FLASH_SR_B0, FLASH_WRPRTERR);
target_write_u32(target, stm32x_get_flash_reg(bank, STM32_FLASH_SR), FLASH_WRPRTERR);
}
}
@ -807,7 +807,7 @@ static int stm32x_write(struct flash_bank *bank, uint8_t *buffer,
return retval;
}
return target_write_u32(target, STM32_FLASH_CR_B0, FLASH_LOCK);
return target_write_u32(target, stm32x_get_flash_reg(bank, STM32_FLASH_CR), FLASH_LOCK);
}
static int stm32x_get_device_id(struct flash_bank *bank, uint32_t *device_id)