cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
4,359 Views
Registered: ‎05-15-2009

sysace_fopen() returns zero after 510 files

Jump to solution

Hello,

 

I have a loop in which each cycle writes a small file to the compact flash using xilfatfs library functions such as  sysace_fopen(), sysace_write() and sysace_fclose(). 

 

The problem is that after writing 510 files, sysace_fopen starts to return zero (no file created). Why is it happening after so many files have been written? I checked and there is still a lot of free space in the CF.

 

Best,

JM

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
5,177 Views
Registered: ‎04-23-2008

Re: sysace_fopen() returns zero after 510 files

Jump to solution

See:

http://en.wikipedia.org/wiki/File_Allocation_Table

"The number of root directory entries available is determined when the volume is formatted, and is stored in a 16-bit signed field, defining an absolute limit of 32767 entries (32736, a multiple of 32, in practice). For historical reasons, FAT12 and FAT16 media generally use 512 root directory entries on non-floppy media."

 

-Brian

View solution in original post

2 Replies
Highlighted
Xilinx Employee
Xilinx Employee
5,178 Views
Registered: ‎04-23-2008

Re: sysace_fopen() returns zero after 510 files

Jump to solution

See:

http://en.wikipedia.org/wiki/File_Allocation_Table

"The number of root directory entries available is determined when the volume is formatted, and is stored in a 16-bit signed field, defining an absolute limit of 32767 entries (32736, a multiple of 32, in practice). For historical reasons, FAT12 and FAT16 media generally use 512 root directory entries on non-floppy media."

 

-Brian

View solution in original post

Highlighted
Explorer
Explorer
4,343 Views
Registered: ‎05-15-2009

Re: sysace_fopen() returns zero after 510 files

Jump to solution

Correct, that was the problem. I wouldn't guess.

More, each sub folder can only have 62 files. Thank you alot.

 

The thing is that as more files are stored, the application becomes slower, I wonder why.. I started to notice after storing 2000 files. Do you have any idea why is this? Mabe sysace_fclose() is a little bit slow synching data with the device?

 

 

Best,

JM

0 Kudos