用lpcopen2.16,启动CM4内核(在BANK A上面),想在BANK B上保存一些数据,所以调用IAP功能如下,其中START_SECTION = 8, END_SECTION = 14,SECTION_NUM = 1,SystemCoreClock= 180000000.
rtn = Chip_IAP_PreSectorForReadWrite(START_SECTION, END_SECTION, SECTION_NUM);
if(rtn != NO_ERR)
{
return FLASH_ERR;
}
rtn = Chip_IAP_EraseSector(START_SECTION, END_SECTION, SECTION_NUM);
if(rtn != NO_ERR)
{
return FLASH_ERR;
}
程序执行到 Chip_IAP_EraseSector时死机。
请问这是怎么回事?
uint8_t Chip_IAP_EraseSector(uint32_t strSector, uint32_t endSector, uint8_t flashBank)
{
uint32_t command[5], result[4];
command[0] = IAP_ERSSECTOR_CMD;
command[1] = strSector;
command[2] = endSector;
command[3] = SystemCoreClock / 1000;
command[4] = flashBank;
iap_entry(command, result);
return result[0];
} |