Page 1 of 6

FAT32 library for MMC/SD cards

Posted: 04 Aug 2011 14:54
by MiloVan
Hello everyone,

FAT32 library for MMC/SD cards is under "heavy" development. Unlike FAT16 library, it will have C-like library interface for file management.
Files will need to be opened, read/written, and eventually closed by user. This library is not likely to be included in future compiler releases, but rather as a part of Libstock.

The concept of file handlers is fully utilized, and the user will be able to define how many file handlers he needs (and consequently, how many files can be opened simultaneously).
The idea is to allow users to work on several files at the same time, and to keep the features of FAT16 library in FAT32 library.

Dear users of MikroElektronika tools and compilers - your questions, suggestions, ideas, and criticism are all welcomed, as always.
I will give my best to answer all your questions, see that as many quality proposals as possible find their way into this library, and gladly discuss with you any specific uses
and scenarios you might have in mind.


Yours truly,
MikroElektronika

Re: FAT32 library for MMC/SD cards

Posted: 04 Aug 2011 15:23
by p.erasmus
MiloVan wrote:This library is not likely to be included in future compiler releases, but rather as a part of Libstock.
This is something I expected when mE post a notification regarding Libstock
some libs will be available in libstock which will be libs the users will have to pay for
is this the intension of the FAT32 library???
if so which will be libraries that comes as a standard with the compilers and which will be additional libraries which
we have to pay for !

Re: FAT32 library for MMC/SD cards

Posted: 04 Aug 2011 16:05
by anikolic
Dear, Peter,
I'm sorry for answering instead of Milovan, but I want to make things clear as soon as possible.

We will not sell FAT32 at Libstock. It will be shared and maintained there for free.
The main reason for this is that with FAT32 placed on Libstock, rather than in compiler itself,
we won't have to pursue 100% backward compatibility with existing FAT libraries at all costs.

So, compilers will retain the original backward compatible libraries,
and we will separately maintain part of the libraries on Libstock on regular basis.

Don't worry, it is not our intention to do any harm, but quite the opposite.

Eventually, some libraries can be included in the compilers directly,
but maintaining them on Libstock will bring much frequent updates of the libraries,
and you won't have to wait for the new compiler releases to get some new functionality.

Best regards,
Aleksandar

Re: FAT32 library for MMC/SD cards

Posted: 04 Aug 2011 16:53
by p.erasmus
Aleksander

Thank you for your quick responce to my post ,
I am very happy to hear this and as you explain it makes sense that the updates can be quicker when
the Libraries is in Libstock. :D :D

Thank you for this
Regards
Peter

Re: FAT32 library for MMC/SD cards

Posted: 18 Aug 2011 15:30
by MiloVan
Hi everyone,

FAT32 Library for C is going to be available very soon on Libstock.
You are very encouraged to try and use it, and please report any suspicious behavior.

File Handler mechanism is implemented, which means several files may be opened at once,
with easy read/write from one to another. The mechanism is described further in the help file.

Directory support has been improved - folders now can be deleted along with their contents,
to a very substantial depth. From anywhere in the directory structure, you can easily return to
the root folder.

Many (if not all) functions report on their success or failure.

Only SD/MMC cards are supported for now. However, there is (yet unfinished mechanism)
to add support for other media, and thus separating FAT32 library from hardware layer.
Once again, more on this subject may be found in the help file :)

Cheers,
MK

Re: FAT32 library for MMC/SD cards

Posted: 29 Aug 2011 12:28
by nuno1024
Dear Sirs,
Of the Libriry FAT32, I think it importatende command to list the files in the MMC.
Regards,
Nuno Ferreira

Re: FAT32 library for MMC/SD cards

Posted: 31 Aug 2011 08:51
by MiloVan
hello nuno,

a function for file listing of the current directory is present in the library.
listing of entire medium was considered, but it was decided not to go with it in this release.
you are correct, this would be a fine addition to the library.

Re: FAT32 library for MMC/SD cards

Posted: 16 Oct 2011 11:36
by m_ezwan86
Hello, there is one more thing here i would like to ask..
Is there any other library function or example that to read the file/folder name and also function to read all the content in the Card? For example, I'have some .mp3 file in the card. I would like to read the file name and display it on lcd or hyperterminal.

One of the function is FAT32_Dir();
When i call this function, all directory in my card displaying automatically on my terminal. I think this is useful for me to get all the file/folder name in my card. But how to grab this data? I think in this function you must be store the data first in the variable before you sent it through UART right. I really want to access this data. I really hope that you can help me.

Re: FAT32 library for MMC/SD cards

Posted: 21 Oct 2011 10:38
by MiloVan
hello m_ezwan86,

FAT32_Dir ( ) invokes another function, FAT32_Dev_PutChar ( ).
this function is available in __Lib_FAT32_Driver.c, and it can be modified to suit your needs and wishes.
you don't need to access this data directly - though there is a way to do so - you need to initialize LCD
and use appropriate function to write single character on the screen.

FAT32_Dir ( ) uses this function as handler for writing single character on screen.
in the example the principle is demonstrated on UART module.

please keep in mind that in the end of each line Carriage Return character is printed.

please contact us if you need further assistance.

Re: FAT32 library for MMC/SD cards

Posted: 24 Oct 2011 10:11
by m_ezwan86
ok. i understand. but actually, i need the file name because of in order to open the file from function "FAT32_Open", we need the file name right? i dont want to code the fixed file name, but i want to read available file name in the card first and then open it.

I have read sd card library from microchip. there have a function search the available file in the card. i think you know it right?
i actually need the function on microC. i really hope you can help me.

Re: FAT32 library for MMC/SD cards

Posted: 24 Oct 2011 10:40
by m_ezwan86
i was implement the fat32 function to play the mp3 music from the card. i just edited from the mp3 example from mikromedia for pic24. the program from what i understand is, its play the mp3 file directly from card just using 2048 buffer size in one time right?

the problem here is the music dont play well, seems that the reading function from the fat32 card is little slow than sending function to the vs1011 chip. what i mean is the vs1011 chip has already finish play the 2048 buffer file but still little bit waiting for another 2048 buffer file. you know what i mean right?

have you test the FAT32 function to play the mp3 file like using fat16? if you have done it, i hope you can share the example the coding to me.

i dont know if my code is wrong. i can post my coding if you request it. TQ.

Re: FAT32 library for MMC/SD cards

Posted: 27 Oct 2011 20:27
by LGR
I see that this exists for C only. Is there a Pascal version, or a Pascal version in the works, or is this intended to only be for C?

Re: FAT32 library for MMC/SD cards

Posted: 28 Oct 2011 08:38
by filip
Hi,

There should be a release for the Basic and Pascal version soon but I cannot promise any dates.

Regards,
Filip.

Re: FAT32 library for MMC/SD cards

Posted: 02 Nov 2011 04:52
by LGR
We've been having a discussion over in the Package Manager forum of some potential problems with Libstock with procedure name conflicts here:

http://www.mikroe.com/forum/viewtopic.php?f=156&t=45087

As complicated libraries like this find their way to Libstock, it seems likely that such conflicts are likely to develop.

If Mikroelectronika manages these libraries, they can coordinate and avoid conflicts, but I'm a little concerned about the opposite problem; that a contributor created a library with a subtle conflict with the mE furnished one.

That's just something to be aware of as libraries migrate to Libstock.

As a matter of fact, there are some loose ends in the Pascal32 compiler; as I recall, you have to turn off the Epson SED13700 library and one or two others to get anything to compile. I see this as a potentially growing nuisance.

Re: FAT32 library for MMC/SD cards

Posted: 13 Feb 2012 11:39
by Gerrit
Very nice lib, but first i would like to find a SD/MMC card which works properly with the SPI protocol.