ZHCAEM6 October   2024 TPS25751 , TPS26750

 

  1.   1
  2.   摘要
  3.   商标
  4. 1引言
  5. 2EEPROM 引导流程
    1. 2.1 引导过程
    2. 2.2 更新 EEPROM 映像
    3. 2.3 命令
    4. 2.4 EEPROM 更新示例
  6. 3源代码示例
    1. 3.1 UpdateRegionOfEeprom()
    2. 3.2 UpdateRegionOfEeprom_Step1
    3. 3.3 UpdateRegionOfEeprom_Step2()
    4. 3.4 UpdatingRegionOfEeprom_Step3()
    5. 3.5 UpdatingRegionOfEeprom_Step4()
    6. 3.6 WriteRegionPointer()
  7. 4从 EEPROM 故障中恢复
  8. 5结语
  9. 6参考资料

UpdateRegionOfEeprom_Step2()

static int32_t UpdateRegionOfEeprom_Step2(uint8_t region_number)
{
uint8_t outdata[MAX_BUF_BSIZE] = {0};
s_TPS_flad fladInData = {0};
uint32_t bytesUpdated = 0;
int32_t retVal = -1;
int32_t idx = -1;
/*
* Set the start address for the next write
*/
fladInData.flashaddr = region_addr_patchbundle[region_number];
retVal = ExecCmd(FLad, sizeof(fladInData), (uint8_t *)&fladInData,
TASK_RET_CODE_LEN, &outdata[0]);
RETURN_ON_ERROR(retVal);
if(0 != outdata[1]) {retVal = -1; goto error;}
for (idx = 0; idx < gSizeLowregionArray/PATCH_BUNDLE_SIZE; idx++)
{
/*
* Execute FLwd with PATCH_BUNDLE_SIZE bytes of patch-data
* in each iteration
*/
retVal = ExecCmd(FLwd, PATCH_BUNDLE_SIZE,\
(uint8_t *)&tps6598x_lowregion_array[idx * PATCH_BUNDLE_SIZE],
TASK_RET_CODE_LEN, &outdata[0]);
RETURN_ON_ERROR(retVal);
if(0 != outdata[1]) {retVal = -1; goto error;}
bytesUpdated += PATCH_BUNDLE_SIZE;
Board_IF_Delay(75); /* in uSecs */
}
/* Push more bytes if any */
if(gSizeLowregionArray > bytesUpdated)
{
retVal = ExecCmd(FLwd, gSizeLowregionArray - bytesUpdated,\
(uint8_t *)&tps6598x_lowregion_array[idx * PATCH_BUNDLE_SIZE],
TASK_RET_CODE_LEN, &outdata[0]);
RETURN_ON_ERROR(retVal);
if(0 != outdata[1]) {retVal = -1; goto error;}
}
error:
return retVal;
}