mirror of https://github.com/RT-Thread/rt-thread
修复stm32l4系列flash在下载完程序后首次擦除会失败的问题
This commit is contained in:
parent
e1cf0cdb6b
commit
53299b9452
|
@ -233,7 +233,7 @@ int stm32_flash_erase(rt_uint32_t addr, size_t size)
|
||||||
HAL_FLASH_Unlock();
|
HAL_FLASH_Unlock();
|
||||||
|
|
||||||
/* Clear OPTVERR bit set on virgin samples */
|
/* Clear OPTVERR bit set on virgin samples */
|
||||||
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR);
|
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR | FLASH_FLAG_PGSERR);
|
||||||
/* Get the 1st page to erase */
|
/* Get the 1st page to erase */
|
||||||
FirstPage = GetPage(addr);
|
FirstPage = GetPage(addr);
|
||||||
/* Get the number of pages to erase from 1st page */
|
/* Get the number of pages to erase from 1st page */
|
||||||
|
|
Loading…
Reference in New Issue