cancel
Showing results for 
Search instead for 
Did you mean: 

EFSL bug + fix

ccowdery9
Associate III
Posted on March 24, 2009 at 11:08

EFSL bug + fix

3 REPLIES 3
ccowdery9
Associate III
Posted on May 17, 2011 at 13:07

All,

I have just encountered an interesting bug with EFSL.

I have it connected via SPI on STM32.

It seems that if I have >127 files, the directory listing / filename discovery functions work (ls_openDir(), ls_getNext()) , but file_fopen doesn't.

In my case, I try to open every file on the SD card to see if it's a certain kind of file. After 127 files, I was getting FILE_NOT_FOUND errors from file_fopen even though I'd got the filename from ls_getNext() !!!

Anyway, I found the following line required some adjustment

dir.c, dir_findinRootArea()

Code:

for(c=fs->FirstSectorRootDir;c<(fs->FirstSectorRootDir+fs->volumeId.RootEntryCount/16);c++){ // THIS VALUE WAS /32

It was prematurely deciding that it had reached the end of the directory listing.

I've tried it with 2048 files on an uSD card, which does now work (albeit it's quite slow to open a file towards the end of the dir structure!)

Hopefully somebody else might find that useful. (or point out that I've made a mistake and my fix isn't right!)

Chris.

sjo
Associate II
Posted on May 17, 2011 at 13:07

Hi,

This is fixed in efsl stable branch (0.2.8):

http://sourceforge.net/tracker/?func=detail&aid=1455268&group_id=131895&atid=722591

perhaps the dev's need informing that it needs merging into 0.3 branch.

Cheers

sjo

ccowdery9
Associate III
Posted on May 17, 2011 at 13:07

Ah, super!

Perhaps I should be using a newer version....!

Chris.