We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello
I have a problem with the file system.
If I write files on a SD card with the LPC2378.
If to many Files are on SD Card the File system is busy until the watchdog makes a reset.
then I write a test rotine. The Result is file 1-50 in 1 sec files 51-75 1 sec 76-85 in 1 sec -100 files 3 sec -120 10sec
then 190 + 1 file 15sec then +1 file 30sec then +1 file 60sec
it seems the Filesystem needs exponential time to create a file with open file...
any one an idea or the same result.
//Test write file volatile static int file_number = 0;
__task void t_save (void) { char filename[40]; char str[] = "Hello World";
int retv = 1;
file_number = 0;
while (retv != 0) { retv = finit (); }
for(;;) { os_dly_wait (10); // watchdog
sprintf(filename, "test%000005d.txt", file_number); file_number++;
FILE* fp = fopen( filename, "wb" ); if(fp != NULL) { fwrite( &str , sizeof(str) , 1 , fp ); fclose(fp); } } }
see here: http://www.keil.com/support/docs/3377.htm
In this case, kicking the watchdog would only be a work-around for a problem somewhere with the file system code. It is a linear operation to scan through a directory. In this case, there must be some buffer thrashing or similar that should be fixed.
Hallo
with kicking the watchdog it run without reset.
I let it run 8 Hours over night and it this morning it have 700 Files written the the time stamp says 4 Minutes from 699 to 700.
this is definitly to slow....
may system is the 3.70 toolchain. And a 1Gb sd card.
thanks
I have the reason and fixed it.
it is the implemantation of write_entries in fs_fat.c
The implemention is not suitable with long filenames and many files in the directory.