代码如下:
FLASH_ProgramWord(flash_addr, flash_word_write);
flash_word_read = *(u32 *)(flash_addr);
printf("flash_word_write:%x\r\n",flash_word_write);
printf("flash_word_read:%x\r\n",flash_word_read);
if(flash_word_write == flash_word_read) //写入FLASH校验
{
flash_addr += br;
}
else break;
程序写flash偶尔会出错,通过WCH-LinkUtility查看flash数据出错,比如写入的是0x1040506f,但实际是0x1040508f