/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / dosfs write file problems

Username:     
Password:     
             

Forum

# 1   2009-04-30 14:40:47 dosfs write file problems

gaglio
New member
Registered: 2009-03-19
Posts: 1

dosfs write file problems

I've write some code to test writefile function:

for(x=0;x<30;x++)
{
    UTIL_uint2str( rstr, x, 3, 1);
    strcpy(CurrentPath, "test");
    strcat(CurrentPath, rstr);
    strcat(CurrentPath, SUFF_FILE);
    fprintf(&uart1_stream, "Current File: ");
    fprintf(&uart1_stream, "%s\n", CurrentPath );
     if (FS_OpenFile(&volume_info, CurrentPath, FS_WRITE, &file_info))
   {
        fprintf(&uart1_stream,"\n Err op: File");
     }
     FS_WriteFile(&file_info, "hello world!!!\r\n", &successcount, 16);
        // FS_Close(&file_info); not necessary...
}

At the end of this code execution I get only test029.REC file ...
It seems that file test000.REC to test028.REC have been replaced by subsequential
new file creations up to last creation test029.REC.

May be that dosfs has some bug?
I've try some different sd but the problem is the same one.
Can anyone help me to understand?

Offline

 

# 2   2009-04-30 15:21:54 dosfs write file problems

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: dosfs write file problems

See: http://www.stm32circle.com/forum/viewtopic.php?id=634
It seems that there is a bug when writing small data. Works with big buffers multiple of the sector size... To be analyzed.

Offline

 

# 3   2009-04-30 16:06:09 dosfs write file problems

Saulis
Member
From: Lithuania
Registered: 2009-04-09
Posts: 34

Re: dosfs write file problems

i think its DOSFS issues, because, in another example prototype i've used FatFs. And it was far better coded than DOSFS. Besides, I've nevere got DosFS running on mine prototype(basically its olimex stm32 board with addon). I had no problems getting fatfs running...

Offline

 

# 4   2009-05-05 07:16:15 dosfs write file problems

ingenius
Member
From: Belgium
Registered: 2009-02-26
Posts: 10

Re: dosfs write file problems

Hi,

Try FAT16 format, with FAT32 I had similar problems on small files.

Offline

 

# 5   2009-05-06 06:19:16 dosfs write file problems

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: dosfs write file problems

If anybody wants to replace the current File System, why not...
Anyway, we will have to keep the current version until the end of the contest. If there any short fix in the current version, it could be done, but we will not publish any major release before August.

Offline

 

Board footer