This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EEPRoom读写问题

Other Parts Discussed in Thread: TMS570LS1225

在使用F021 API 对TMS570LS1225的EEPRoom进行读写的时候发现只有先写入数据才可以读出来数据,但是一掉电读取的数据都变为0,不知道是什么原因。调用api初始化函数时不知道会不会格式化EEPRoom,以下是初始化函数和调用的函数:

void epp_init(void)
{
/* Initialize FEE. This will create Virtual sectors, initialize global variables etc.*/
TI_Fee_Init();
do
{
TI_Fee_MainFunction();
epp_delay();
Status=TI_Fee_GetStatus(0);
}
while(Status!= IDLE);
}

void epp_R_W(void)
{
unsigned int BlockNumber;
unsigned int BlockOffset, Length;
unsigned int loop;
unsigned char *Read_Ptr=read_data;

/* Initialize RAM array.*/
for(loop=0;loop<10;loop++)SpecialRamBlock[loop] = loop;

/* Write the block into EEP Asynchronously. Block size is configured in ti_fee_cfg.c file.
* Default Block size is 8 bytes */
BlockNumber=0x1;
/**/TI_Fee_WriteAsync(BlockNumber, &SpecialRamBlock[0]);
do
{
TI_Fee_MainFunction();
epp_delay();
Status=TI_Fee_GetStatus(0);
}
while(Status!=IDLE);

/* Write the block into EEP Synchronously. Write will not happen since data is same. */
//TI_Fee_WriteSync(BlockNumber, &SpecialRamBlock[0]);
/* Read the block with unknown length */
BlockOffset = 0;
Length = 0xFFFF;
TI_Fee_Read(BlockNumber,BlockOffset,Read_Ptr,Length);
do
{
TI_Fee_MainFunction();
epp_delay();
Status=TI_Fee_GetStatus(0);
}
while(Status!=IDLE);
}