FAT32 library for MMC/SD cards
- janko.kaljevic
- Posts: 3565
- Joined: 16 Jun 2011 13:48
Re: FAT32 library for MMC/SD cards
Hello,
I was unable to reproduce the same compiling errors from the first picture on mikroBasci PRO for dsPIC v5.7.0
I confirm that I used Fat32_1.mcl and Fat32_2.mcl files from Dany's post above and StrngUtils.mcl downloaded from here:
http://www.libstock.com/projects/view/39/utilities
Errors from second picture I was able to reproduce only with SSA disabled, which is expected if Dany have built the library with SSA on.
Best regards.
I was unable to reproduce the same compiling errors from the first picture on mikroBasci PRO for dsPIC v5.7.0
I confirm that I used Fat32_1.mcl and Fat32_2.mcl files from Dany's post above and StrngUtils.mcl downloaded from here:
http://www.libstock.com/projects/view/39/utilities
Errors from second picture I was able to reproduce only with SSA disabled, which is expected if Dany have built the library with SSA on.
Best regards.
- Attachments
-
- FAT32.JPG (122.62 KiB) Viewed 14842 times
- janko.kaljevic
- Posts: 3565
- Joined: 16 Jun 2011 13:48
Re: FAT32 library for MMC/SD cards
Hello,
We'll contact Dany with this idea. He is a dedicated contributor, and we think that entire community may benefit of this. (of course Dany would have a lot more coding to do, to fulfill your expectations )
We'll contact Dany with this idea. He is a dedicated contributor, and we think that entire community may benefit of this. (of course Dany would have a lot more coding to do, to fulfill your expectations )
Re: FAT32 library for MMC/SD cards
I discovered that Fat32_2 and StrngUtils were build with SSA off...janko.kaljevic wrote:Hello,
I was unable to reproduce the same compiling errors from the first picture on mikroBasci PRO for dsPIC v5.7.0
I confirm that I used Fat32_1.mcl and Fat32_2.mcl files from Dany's post above and StrngUtils.mcl downloaded from here:
http://www.libstock.com/projects/view/39/utilities
Errors from second picture I was able to reproduce only with SSA disabled, which is expected if Dany have built the library with SSA on.
Best regards.
That seemed to be the reason of the problem: I get no "call signature" errors any more with attached versions of Fat32_1, Fat32_2 and StrngUtils, all build with SSA on.
In the mean time the my libraries in LibStock and on my website are updated. With my excuses for the inconvenience..
- Attachments
-
- StrngUtils.zip
- Library is built with SSA on
- (61.11 KiB) Downloaded 471 times
-
- Fat32_2.zip
- Library is built with SSA on
- (82.78 KiB) Downloaded 466 times
-
- Fat32_1.zip
- Library is built with SSA on
- (77.66 KiB) Downloaded 476 times
Last edited by Dany on 07 Dec 2012 13:56, edited 2 times in total.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Re: FAT32 library for MMC/SD cards
I feel honored.janko.kaljevic wrote:Hello,
We'll contact Dany with this idea. He is a dedicated contributor, and we think that entire community may benefit of this. (of course Dany would have a lot more coding to do, to fulfill your expectations )
I must admit however that I am not capable of translating projects/libraries written in one language to another one.
This would be relatively easy for mP <-> mB, but impossible for me if mC comes into focus... So I must disappoint you there, I am a Pascal user and I will always be one.
The only thing I could do extra then (using the proposed licenced compilers) is testing if e.g. libraries written in mP are also usable in mP or mC, if I can translate e.g. the mP testcases to e.g. mB.
Serkansatuk (http://www.mikroe.com/forum/viewtopic.php?f=146&t=51768) proposed to develop a tool for source code translation. This would be of course THE solution...
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
-
- Posts: 38
- Joined: 31 May 2012 07:05
Re: FAT32 library for MMC/SD cards
Thanks for your interest.
I disabled and enabled the SSA optimization, and the project has been compiled successfully.
Is this a bug for the compiler ???
I disabled and enabled the SSA optimization, and the project has been compiled successfully.
Is this a bug for the compiler ???
Re: FAT32 library for MMC/SD cards
I know how you feel, Dany. I'd rather crawl over broken glass than program in C, or any of it's derivatives such as Java. I had to do some Java programming for an Android app, and it was agony. If a modern OO language is needed, my first choice is Lazarus/Freepascal (very similar to Delphi), and second choice is Python.
After I finished, I learned that there's an excellent BASIC for Android called ... basic4android.
After I finished, I learned that there's an excellent BASIC for Android called ... basic4android.
If you know what you're doing, you're not learning anything.
Re: FAT32 library for MMC/SD cards
No, it is'nt. It was my mistake , libraries should be compiled with SSA on. I will update the libstock content as soon as possible... (done on 2012-12-07)serkansatuk wrote:Is this a bug for the compiler ???
I am happy the idea of the mP libs usage possibility in mB still holds...
Last edited by Dany on 07 Dec 2012 13:54, edited 1 time in total.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Re: FAT32 library for MMC/SD cards
LGR wrote:I'd rather crawl over broken glass than program in C, or any of it's derivatives such as Java.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
- janko.kaljevic
- Posts: 3565
- Joined: 16 Jun 2011 13:48
Re: FAT32 library for MMC/SD cards
Hello,
mB and mP are very compatible and the library built in one will work perfectly fine in other.
There should be no issues at all.
Also there is a great level of compatibility with C too. If user takes care about some C specific stuff and libraries (like string) it will work fine in all three compilers.
Best regards.
mB and mP are very compatible and the library built in one will work perfectly fine in other.
There should be no issues at all.
Also there is a great level of compatibility with C too. If user takes care about some C specific stuff and libraries (like string) it will work fine in all three compilers.
Best regards.
Re: FAT32 library for MMC/SD cards
Nice!janko.kaljevic wrote:Hello,
mB and mP are very compatible and the library built in one will work perfectly fine in other.
There should be no issues at all.
Also there is a great level of compatibility with C too. If user takes care about some C specific stuff and libraries (like string) it will work fine in all three compilers.
Best regards.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)
Re: FAT32 library for MMC/SD cards
Possibly a silly question but, do I need to re-initialize the FAT32_Init() function after removal and re-insertion of a SD card?
For instance: I have an interrupt listening when a card is removed or inserted. I have it running the init() function again and have found that everything is working, but, is that totally necessary?
For instance: I have an interrupt listening when a card is removed or inserted. I have it running the init() function again and have found that everything is working, but, is that totally necessary?
- dejan.odabasic
- mikroElektronika team
- Posts: 2649
- Joined: 30 Apr 2012 14:20
Re: FAT32 library for MMC/SD cards
Hello,
Yes, you need to call FAT32_Init() when you swap the MMC cards.
Yes, you need to call FAT32_Init() when you swap the MMC cards.
Best regards.Help file wrote:Initializes the storage device, reads FAT32 boot sector and extract necessary file system data required by the library.
Re: FAT32 library for MMC/SD cards
Ok, have another question that might seem silly.
Once I assign a file handle to a file and open it. If I change directories, do I have to go back to that directory to close it?
If this is the case, is there anywhere in the library that the directory is stored for me?
I am also keeping the file handle as part of a struct that is holding all my socket data:
Another question: Is FAT32_Read a blocking function? Should I allow for time to "read" data into the buffer?
It would be neat if I could read the size of the buffer free on the Ethernet library and use it as my buffer that the FAT32_Read transfers data into directly instead of having 2 buffers...
Once I assign a file handle to a file and open it. If I change directories, do I have to go back to that directory to close it?
If this is the case, is there anywhere in the library that the directory is stored for me?
I am also keeping the file handle as part of a struct that is holding all my socket data:
Code: Select all
struct webSocket_desc{
SOCKET_28j60_Dsc *socket; /*!< Socket for TCP connection */
char mark; /*!< Mark if socket is in use or free */
unsigned long position; /*!< Position of where in the packet it has transmitted */
char fileName[COMMANDSIZE]; /*!< The file name associated with the socket */
short fileHandle; /*!< Filehandle of the file used by FAT32 */
unsigned long fileSize; /*!< The file size in bytes */
unsigned char buffer[DATABUFFERSIZE]; /*!< Buffer for reading from the file and ready to send */
unsigned int bufPos; /*!< Where in the buffer has it sent, when at the end, time for recharge if not EOF */
};
It would be neat if I could read the size of the buffer free on the Ethernet library and use it as my buffer that the FAT32_Read transfers data into directly instead of having 2 buffers...
- dejan.odabasic
- mikroElektronika team
- Posts: 2649
- Joined: 30 Apr 2012 14:20
Re: FAT32 library for MMC/SD cards
Hello,
Best regards.
No you don't, file handler doesn't depend on "your" position in folder tree.borris wrote:Once I assign a file handle to a file and open it. If I change directories, do I have to go back to that directory to close it?
FAT32_Read function is blocking function, after the buffer is filled/data read, the application continues with execution (no need for delay after calling FAT32_Read).borris wrote:Is FAT32_Read a blocking function? Should I allow for time to "read" data into the buffer?
Best regards.
Re: FAT32 library for MMC/SD cards
Hi,
I read the Mmc_Fat library but I don't understand well the next routine:
Mmc_Fat_Assing( filename , file_cre_attr)
in the part the "file_cre_attr" how is the configuraion of bits? in the example of mikroE has 0xA0 but I don't understand where this value.
thanks for your time..
JulioZV
PD. sorry for my english.
I read the Mmc_Fat library but I don't understand well the next routine:
Mmc_Fat_Assing( filename , file_cre_attr)
in the part the "file_cre_attr" how is the configuraion of bits? in the example of mikroE has 0xA0 but I don't understand where this value.
thanks for your time..
JulioZV
PD. sorry for my english.