Part Number: AM3352
Hello:
I am using ti sdk V03_03_00_04
there is problem when we test the emmc write using the following code.
double tBetween;
if( clock_gettime( CLOCK_MONOTONIC, &ts_get_before) != 0 )
perror("get clock fail");
fp = fopen(filename, "a+");//a+
for(i = 0; i < FILE_SIZE; i++)
{
buffWrite[i] = (unsigned short)rand();
}
fileLength = fwrite(buffWrite, sizeof(unsigned short), FILE_SIZE, fp);
fd=fileno(fp);
fsyn(fd);
if(fileLength != FILE_SIZE)
{
printf("write file %s error! fileLength:%d \n", filename, fileLength);
fclose(fp);
}
else
{
fclose(fp);
}
if( clock_gettime( CLOCK_MONOTONIC, &ts_get_af) != 0 )
perror("get clock fail");
tBetween=(ts_get_af.tv_sec- ts_get_before.tv_sec)*1000+(ts_get_af.tv_nsec-ts_get_before.tv_nsec)*0.000001;
The FILE_SIZE is 50K,so every time it write 100KB size to the emmc ,I print the tBetween ,In 3 hour test ,it is about 18s one time ,
sometime about 1 to 1.5 s, but most time it is about 2 ms.
What is wrong?When do the test ,there is no other application run on my board.
Is there any bug exist in the emmc driver ?