Hello,
We are developing with SDK 8.6, and under FreeRTOS, we have written a test program that writes to the EEPROM every 10ms at address 0xFF00 with data ranging from 0 to 100. Then, it reads back the data from this address for verification. Occasionally, the read data appears as 0, which is inconsistent with the written data. Currently, this error seems to occur with a relatively high probability specifically at address 0xFF00. The components used are consistent with the development board, and the code directly calls the library functions.
uint16_t tmp1=0,tmp1Bak=0,tmpwdata=0x1234;
#define TestAddr 0xff01
uint16_t eetesti=0;
void eetest()
{
uint16_t i=0;
int32_t status = OK;
if(EEPROM_read(gEepromHandle[CONFIG_EEPROM0],TestAddr,(uint8_t *)&tmp1,2)!= SystemP_SUCCESS)
{
DebugP_log("read error addr = %d\r\n",TestAddr);
}
DebugP_log("tmp1 = %d\r\n",tmp1);
for(eetesti=0;eetesti<100;eetesti++)
{
wdg_cpld();
status = EEPROM_write(gEepromHandle[CONFIG_EEPROM0], TestAddr, (const uint8_t*)&eetesti, 2);
if(status != OK)
{
DebugP_log("===== write err = %d\r\n",TestAddr);
}
tmp1Bak = 0;
if(EEPROM_read(gEepromHandle[CONFIG_EEPROM0],TestAddr,(uint8_t *)&tmp1Bak,2)!= SystemP_SUCCESS)
{
DebugP_log("read tmp1Bak error addr = %d\r\n",TestAddr);
}
if(eetesti!=tmp1Bak)
{
DebugP_log("write err i= %d,tmp1Bak = %d\r\n",eetesti,tmp1Bak);
EEPROM_read(gEepromHandle[CONFIG_EEPROM0],TestAddr,(uint8_t *)&tmp1Bak,2);
}
}
}
