Hi team,
Here's an issue from the customer may need your help:
The in-chip bank 7 is operated using TI's FEE driver code. When configuring the chip, bank7 is divided to 24 blocks, each of which is 64 words. First call the function TI_Fee_EraseImmediateBlock to erase the block, and then write the block. But there were occasional erase failures, the customer would like to know why is that. Below is the code for write:
void SysParamWriteBlock(uint16_t uIBlockNumMax)
{
Std_ReturnType Rtn;
if(u32FeeWriteBlockNum < 24U)
{
Rtn = TI_Fee_EraseImmediateBlock(uIFeeWriteBlockNum+1U);
if(E_OK == Rtn)
{
u32EepEreasseFlg = 0U;
}
else
{
u32EepEreasseFlg |= bTrue;
}
wdg_feed(); /*In-chip watchdog feeding the dog with a watchdog overflow time of 100 ms */
if(eepBlockInforStu[uIFeeWriteBlockNum%24U].blockData != NULL)
{
u32EepromWriteFlg |= eeprom_write_block(uIFeeWriteBlockNum+1U,(uint8_t*)eepBlockInforStu[u32FeeWriteBlockNum%24U].blockData);
}
u32FeeWriteBlockNum++;
}
}
static uint32_t eeprom_write_block(uint16_t blockNum,uint8 *pData)
{
Std_ReturnType oResult=E_NOT_OK;
uint32_t uIResultBit=bFalse;
uint16 Status;
uint32 delay_cnt=0U;
do{
TI_Fee_MainFunction();
eep_delay();
Status=TI_Fee_GetStatus(0U);
delay_cnt++;
}
while((Status!=IDLE) && (delay_cnt < 1000U));
if(Status==IDLE)
{
/* Write the block into EEP aSynchronously. */
oResult = TI_Fee_WriteAsync(blockNum, pData);
}
delay_cnt = 0U;
do{
TI_Fee_MainFunction();
eep_delay();
Status=TI_Fee_GetStatus(0U);
delay_cnt++;
}
while((Status!=IDLE) && (delay_cnt < 1000U));
oResult = TI_Fee_WriteSync(blockNum, pData);
delay_cnt = 0U;
do{
TI_Fee_MainFunction();
eep_delay();
Status=TI_Fee_GetStatus(0U);
delay_cnt++;
}
while((Status!=IDLE) && (delay_cnt < 1000U));
if(oResult==E_OK)
{
uIResultBit = bFalse;
}
else
{
uIResultBit = bTrue;
}
return uIResultBit;
}
Trace to the TI_FeeInternal_CheckModuleState function returns TI_Fee_GlobalVariables[0].Fee_ModuleState == BUSY_INTERNAL, is it related to the frequent operation?
Could you help check this case? Thanks.
Best Regards,
Cherry