mirror of https://github.com/ARMmbed/mbed-os.git
Clear error programming flags before erase & program operations
parent
ac6ca73dd8
commit
3a6b52fd15
|
@ -137,6 +137,9 @@ int32_t flash_erase_sector(flash_t *obj, uint32_t address)
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* Clear error programming flags */
|
||||
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_ALL_ERRORS);
|
||||
|
||||
/* Clear OPTVERR bit set on virgin samples */
|
||||
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR);
|
||||
/* Get the 1st page to erase */
|
||||
|
@ -194,6 +197,9 @@ int32_t flash_program_page(flash_t *obj, uint32_t address,
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* Clear error programming flags */
|
||||
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_ALL_ERRORS);
|
||||
|
||||
/* Program the user Flash area word by word */
|
||||
StartAddress = address;
|
||||
|
||||
|
|
Loading…
Reference in New Issue