Other Parts Discussed in Thread: AM6422
器件型号: AM6422
您好:
我们正在使用 SDK 8.6 进行开发、在 FreeRTOS 下、我们编写了一个测试程序、每 10ms 在地址 0xFF00 处写入一次 EEPROM、数据范围为 0 至 100。 然后、它从该地址读回数据以进行验证。 有时、读取的数据会显示为 0、这与写入的数据不一致。 目前、特别是在地址 0xFF00 处发生该误差的概率相对较高。 使用的组件与开发板一致、并且代码直接调用库函数。
uint16_t tmp1=0、tmp1ak=0、tmpwdata=0x1234;
#define TestAddr 0xff01
uint16_t EEtesti=0;
空 EEtest()
{
uint16_t i=0;
int32_t 状态=正常;
if (eepromHandle[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(“====== 写入错误=%d\r\n“、TestAddr);
}
tmp1BAK = 0;
if (eepromHandle[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 erri =%d、tmp1Bak =%d\r\n“、eetesti、tmp1Bak);
EEPROM_Read (gEepromHandle[CONFIG_EEPROM0]、TestAddr、(uint8_t *)&tmp1BAK、2);
}
}
}

