This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

FlasFS - slowing to record files

I am develop an application that will store data into a SD. I am having problems with times of record using the FlashFS. After record some LOGs, recording new entries is very slow. I am using:
LPC1768 @ CCLK = 100 MHz
RL-ARM 4.1
4GB SDHC Class 10 SD Card

Below my function for record:

void Record_Event (unsigned char log_type, unsigned int id)
{
        char f_name[30];
        FILE *logs_file;
        sprintf(f_name,"%2.2d%2.2d%2.2d%2.2d%2.2d%2.2d.LOG",LPC_RTC->DOM,LPC_RTC->MONTH,LPC_RTC->YEAR,LPC_RTC->HOUR,LPC_RTC->MIN,LPC_RTC->SEC);
        logs_file = fopen (f_name, "wb");               /* open a file for writing           */
        if (logs_file == NULL)
        {
                return;
        }
        fputc  (log_type, logs_file);
        fputc  ((id) & 0xFF,logs_file);
        fputc  ((id >> 8) & 0x00FF,logs_file);

        fclose (logs_file);                         /* close the output file               */
}

The recording time for up to 60 files is less than 1 second, but when already exist more than 60 files in SD Card, the new recordings are slower. The times for new recordings are:
up to 60 files = 1s or less
60-70 = 1,5s
70-100 = 3s
100-150 = 5s

does anyone know why? any help is welcome.

0