<font face="Tahoma, Verdana, Arial, Microsoft Yahei, sans-serif" style="outline: none; color: rgb(0, 0, 0); font-size: 15px; background-color: rgb(232, 232, 232);"><font color="#333333" style="outline: none;"><font style="outline: none; font-size: 14px;">
</font></font></font><font style="outline: none; font-size: 15px; background-color: rgb(232, 232, 232); color: rgb(51, 51, 51);"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"></font></font><font color="#333333" style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;">HAL_FLASH_Unlock();</font></font></font>
<font style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"></font></font><font color="#333333" style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;">Page_Mum = GetPage(addr);</font></font></font>
<font style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"></font></font><font color="#333333" style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;">FlashEraseInit.TypeErase=FLASH_TYPEERASE_PAGES; //擦除类型,页擦除</font></font></font>
<font style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"></font></font><font color="#333333" style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;">FlashEraseInit.Page=Page_Mum; </font></font></font><font style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"> </font></font></font><font color="#333333" style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"> </font></font></font><font style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"> </font></font></font><font color="#333333" style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;">//从哪页开始擦除</font></font></font>
<font style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"></font></font><font color="#333333" style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;">FlashEraseInit.NbPages=pagenum; </font></font></font>
<font style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"></font></font><font color="#333333" style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;">if(HAL_FLASHEx_Erase(&FlashEraseInit&PageError)!=HAL_OK)</font></font></font>
<font style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"></font></font><font color="#333333" style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;">{</font></font></font>
<font style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"></font></font><font color="#333333" style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;">printf("flash_error_addr:%x\r\n"PageError);</font></font></font>
<font style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"></font></font><font color="#333333" style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;">printf("flash_easre_error\r\n");</font></font></font>
<font style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"></font></font><font color="#333333" style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;">while(1);</font></font></font>
<font style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"></font></font><font color="#333333" style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;">}</font></font></font>
<font style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;"></font></font><font color="#333333" style="outline: none;"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;">FLASH_WaitForLastOperation(FLASH_WAITETIME); //等待上次操作完成</font></font></font>
<div align="left" style="outline: none; word-break: break-all; color: rgb(0, 0, 0);"><font style="outline: none; color: rgb(51, 51, 51);"><font face="Tahoma, Verdana, Arial, "" style="outline: none;"><font style="outline: none; font-size: 14px;">HAL_FLASH_Lock();</font></font></font></div></font></font></font></font></font></font></font></font></font></font></font></font>