Page 3 of 5

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 20 Sep 2012 16:24
by lucaTFI
OK, I thought you'd reconnected who I was, saw the post test that I had written on the format function is not working.
The micro is the 18F46J50 used to 8MHz

Fat32 is initialized earlier in the code, however I have found that it is a problem of the number of characters in the name of the new file. You declare standard is 8.3, but in the function "rename" you get to 7.3 and everything works. You probably have a problem in the library on the length of the file name. I wanted to tell also that the function "FAT32_WRITE" occasionally has problems and arrives to trigger the WDT, if not spaced of 100ms between the function "FAT32_EXISTS", the function "FAT32_Open" and the function "FAT32_WRITE". Please check the library, because it is very important for many projects. When do you plan to release a new version? I can possibly test a new beta version?
thanks

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 01 Oct 2012 11:12
by Dany
Hi,

The possibility exists now to use the Fat32 library of mE together with the USB MSD host library (see http://www.mikroe.com/forum/viewtopic.p ... 50#p197339), making it possible to access files on a USB memory stick:

Adapted the hardware driver for the Fat32 library of MikroElektronika to be able to handle the USB stick software, see http://www.rosseeld.be/DRO/PIC/__Lib_FAT32_Driver.mpas.

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 19 Dec 2012 21:55
by relinquished
Hi, I would like to know if there are any examples for these new libraries.

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 24 Dec 2012 14:10
by Dany
relinquished wrote:Hi, I would like to know if there are any examples for these new libraries.
Examples can always be found in the "examples" directories in the libraries packages.
They can be viewed with the package manager, and after installation of the package they are to be found in
<installation directory>\Packages\<package name>\examples\

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 06 Mar 2013 15:55
by carit
Hi; mikroelektronika support team :D

I am using LV 32MX V6 development board
http://www.mikroe.com/products/view/462 ... nt-system/
and mikroC pro for pic32
FAT32 library FAT32_Seek not working

Code: Select all

#include "__Lib_FAT32.h"
sbit Mmc_Chip_Select           at LATG9_bit;  // for writing to output pin always use latch
sbit Mmc_Chip_Select_Direction at TRISG9_bit;

short fhandle;

void main() {
 TRISB=0;
 PORTB=0;
 AD1PCFG = 0xFFFF;                      // configure AN pins as digital I/O
 SPI2_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, 64, _SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_HIGH, _SPI_ACTIVE_2_IDLE);
   if (0 == FAT32_Init())
       portb=0xFFFF;
 SPI2_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, 8, _SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_HIGH, _SPI_ACTIVE_2_IDLE);
      
      fhandle = FAT32_Open("X_FILES.TXT", FILE_APPEND);
      FAT32_Write(fhandle,"mikroC PRO for pic32",21);
      fhandle = FAT32_Open("X_FILES.TXT",  FILE_APPEND);
       FAT32_Seek(fhandle, 200);
      FAT32_Write(fhandle,"Mikroelektronika development tools",34);
      FAT32_Close(fhandle);
}
created text file;

Mikroelektronika development tools

cursor not seeking
trying else code

Code: Select all

#include "__Lib_FAT32.h"
sbit Mmc_Chip_Select           at LATG9_bit;  // for writing to output pin always use latch
sbit Mmc_Chip_Select_Direction at TRISG9_bit;

short fhandle;

void main() {
 TRISB=0;
 PORTB=0;
 AD1PCFG = 0xFFFF;                      // configure AN pins as digital I/O
 SPI2_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, 64, _SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_HIGH, _SPI_ACTIVE_2_IDLE);
   if (0 == FAT32_Init())
       portb=0xFFFF;
 SPI2_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, 8, _SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_HIGH, _SPI_ACTIVE_2_IDLE);
      
      fhandle = FAT32_Open("X_FILES.TXT", FILE_APPEND);
      FAT32_Write(fhandle,"mikroC PRO for pic32",21);
       FAT32_Close(fhandle);
     fhandle = FAT32_Open("X_FILES.TXT", FILE_WRITE);
     FAT32_Seek(fhandle, 1000);
     FAT32_Close(fhandle);
       fhandle = FAT32_Open("X_FILES.TXT", FILE_APPEND);
      FAT32_Write(fhandle,"Mikroelektronika development tools",34);
      FAT32_Close(fhandle);

}
created text file;

mikroC PRO for pic32 Mikroelektronika development tools

cursor not seeking

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 31 Mar 2013 10:18
by carit
the problem is solved thanks dejan odabasic :D :D :D

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 04 Apr 2013 16:47
by LGR
Maybe this is obvious, and already in the plans, but...

You have all the elements between the Net_Ethernet and FAT32 libraries necessary for a file server. It would be nice to have this built in, so that when a properly formed GET request arrives in the Ethernet buffer, it attempts to find and send the file.

I would think that this would be easy to implement as a library routine that is called from inside of the UserTCP function.

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 09 Apr 2013 10:29
by sairfan1
wow, its really very helpful, thanks to mikroe team.

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 13 Mar 2014 13:36
by Ing.Giovanni.Vitale
Hello, I would like to know if they are available for the library ehternet mikromedia 5 for Tiva, and a working example. I wish I could display on the TFT screen images from an ip cam with static ip connected with a cross cable tive.
thanks for the help

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 14 Mar 2014 09:42
by filip
Hi,

I believe we have the same correspondence via e-mail, so lets please continue there.

Regards,
Filip.

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 17 Mar 2014 12:29
by Ing.Giovanni.Vitale
Yes, we have a correspondence via email. I was hoping that other users could help me, maybe someone managed to make something that worked with the library to tiva129. I have compiled 3 example programs, adapted to mikromedia for TIVA with its associated library, as there is a working example as for the wifi. Where is made available to the full sample WiFi_Camera. I thank the staf of Mikroelektronika, but still have not solved the problem and I have a sense of urgency to finish this work. All the examples I've changed give me the same problem, the hardware ethernet does not communicate, and do not turn on the LEDs to communicate status of the communication. I can not understand whether it is due to a programming error made ​​by me, or if you have to effetttuare the GPIO settings for which they are not aware of.

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 18 Mar 2014 13:34
by filip
Hi,

I have sent you the requested project on the e-mail, please check your inbox.

Regards,
Filip.

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 08 May 2014 15:51
by robfaz
Hi,
I'm using the fat32 libstock library routines to write a file on an sd card and everything is ok, but if I add in the program setting spdr for communication via spi with other devices happens that new program write operations on files are not complete and more precisely "mmc_error : = FAT32_Write (fHandle , @bufferr, 100); " Returns mmc_error = 255.
I have done numerous tests and the problem occurs after the first time after the first time you perform an assignment operation to spdr for example spdr: = c.
I attached a picture of the code.

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 09 May 2014 14:39
by marina.petrovic
Hi,

I believe that I answered you on this question on this forum topic:
http://www.mikroe.com/forum/viewtopic.p ... 82#p237982

Best regards,
Marina

Re: Libstock exclusive: FAT32 and Network Ethernet Libraries

Posted: 19 May 2014 03:53
by Stiive
Hi,
I'm having a problem with the FAT32 library on the Mikromedia plus STM32.

I am datalogging using swap files.
Once I fill up the amount of sectors available in the swap file, I create a new swap file and continue logging to the new file.

Everything works well until I have created about ~125 logs, and then the system freezes on the FAT32_MakeSwap command and the SDcard becomes corrupted.

I am using a 8Gb SD card, there is plenty of room remaining on the SD card when this happens. As a test, I have changed the amount of sectors per swap file, so the total amount of data written is very different - yet is still freezes somewhere between 123 and 126 swap log files created. I guess this removes the possibility of a bad sector causing the freeze.

When I remove the SDCard while its frozen - it then exits the MakeSwap function and returns the error -36 (file is not opened). (FYI - I open the file after the making the swap file otherwise my code doesn't work at all). Once I have removed the card after it had frozen, the data is generally corrupted and I can't see any of the swap files or they are all blank. I have assigned all my values to uint16/32, so should not be caused by an overflow, unless it is something internal to the MakeSwap function (signed short?). Sometimes, If i remove the SD card before the error, and then reset the application, it will make it to about ~255logs and then freeze (e.g logging starts at swap file number 120, then 121, 122... etc). Weird.

Any thoughts?
If this cause of this problem is unknown, it would be great if this function could include a timeout?

At the moment, I am not rewriting the file from swap to normal fat32 as I can see it fine on the PC anyway and download the data. Is there any issues with doing this?

Cheers