slow fflush on ME9210 - NetOs


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?


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

I’m porting Sedona ( 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/";

/* Initialize the system services for the application. */

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

Thanks for answer , check my comment below.


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.