我在官方iap上改,在以前103上完成的改都出现一个问题,不光是擦除还是写,总是返回flash_error_program
在代码简化到只剩
FLASH_Unlock();
FLASH_ClearFlag(FLASH_FLAG_PGSERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_WRPERR | FLASH_FLAG_OPERR | FLASH_FLAG_EOP);
FLASH_OB_Unlock();
FLASH_OB_WRPConfig(OB_WRP_Sector_4, DISABLE);
FLASH_OB_WRPConfig(OB_WRP_Sector_5, DISABLE);
FLASH_OB_WRPConfig(OB_WRP_Sector_6, DISABLE);
FLASH_OB_WRPConfig(OB_WRP_Sector_7, DISABLE);
FLASH_EraseSector(FLASH_Sector_4,VoltageRange_3);
FLASH_EraseSector(FLASH_Sector_5,VoltageRange_3);
FLASH_EraseSector(FLASH_Sector_6,VoltageRange_3);
FLASH_EraseSector(FLASH_Sector_7,VoltageRange_3);
也是一样,每一句擦除与设置写保护失效都返回flash_error_program这可能是什么原因呢? |