2009-03-24 03:08 AM
EFSL bug + fix
2011-05-17 04:07 AM
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.2011-05-17 04:07 AM
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 sjo2011-05-17 04:07 AM
Ah, super!
Perhaps I should be using a newer version....! Chris.