SLVAFL1 October 2024 TPS25751 , TPS26750
static int32_t WriteRegionPointer(const uint8_t region_number, const uint32_t value)
{
uint8_t outdata[MAX_BUF_BSIZE] = {0};
s_TPS_flad fladInData = {0};
uint32_t regionVal = 0;
int32_t retVal = -1;
fladInData.flashaddr = region_ptr_start[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;}
retVal = ExecCmd(FLwd, sizeof(uint32_t), (uint8_t *)&value, TASK_RET_CODE_LEN, &outdata[0]);
RETURN_ON_ERROR(retVal);
if(0 != outdata[1]) {retVal = -1; goto error;}
retVal = ExecCmd(FLrd, sizeof(uint32_t), (uint8_t *)®ion_ptr_start[region_number],
sizeof(s_TPS_flrdassert), &outdata[0]);
RETURN_ON_ERROR(retVal);
regionVal = (outdata[4] << 24) | (outdata[3] << 16) | (outdata[2] << 8) | (outdata[1] << 0);
if(value != regionVal) {retVal = -1; goto error;}
error:
return retVal;
}