slow fflush on ME9210 - NetOs

Hi

I’m trying to make blank 32k file.
I open file, use seek function to go to end of file, write 0 and then execute fflush.

It takes almost 10 minutes to create blank 32k file.

Is there way to speed up and why is so slow?

can you post your code here?

Also can you tell me why are you doing this?

Hi

What version of NET+OS?
What module are you running this on?
Are you writing to RAM (file system) or FLASH (file system)?

Hi
I’m porting Sedona (sedonadev.org) virtual machine to NetOs 7.5 and ME9210, sedona creates one empty 32k file to use for histories. I can’t change that because it is part of Sedona .

This is simple version how code looks, I tested this and takes a 5-10 min to flush this to drive, and program is stuck on fflush.

FILE* fp;
char* FileName="FLASH0/test.data";

/* Initialize the system services for the application. */
initAppServices();

//delete file
remove(FileName);
// create file
printf ("Create File: %s",FileName);
fp = fopen(FileName, "a+b");
fclose(fp);
// open file
fp = fopen(FileName, "r+b");
// go to end
fseek(fp, 32768, SEEK_SET);
// write to end
fputc(0x00, fp);
// flush
fflush(fp);
// close
fclose(fp);

Hi
Thanks for answer , check my comment below.

Hello

Is there anyway you can replace the fseek, fputc and fflush with an fwrite and fflush. You can write 32kb of anything to FLASH in no time. I know you originally stated you can’t but I figured I’d ask once more.