Libstock exclusive: FAT32 and Network Ethernet Libraries
Re: Libstock exclusive: FAT32 and Network Ethernet Libraries
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
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
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.
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.
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: 222
- Joined: 09 Apr 2011 11:08
- Location: ITALY / NAPOLI
Re: Libstock exclusive: FAT32 and Network Ethernet Libraries
Hi, I would like to know if there are any examples for these new libraries.
Re: Libstock exclusive: FAT32 and Network Ethernet Libraries
Examples can always be found in the "examples" directories in the libraries packages.relinquished wrote:Hi, I would like to know if there are any examples for these new libraries.
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\
Last edited by Dany on 06 Mar 2013 18:14, 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: Libstock exclusive: FAT32 and Network Ethernet Libraries
Hi; mikroelektronika support team
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
created text file;
Mikroelektronika development tools
cursor not seeking
trying else code
created text file;
mikroC PRO for pic32 Mikroelektronika development tools
cursor not seeking
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);
}
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);
}
mikroC PRO for pic32 Mikroelektronika development tools
cursor not seeking
Re: Libstock exclusive: FAT32 and Network Ethernet Libraries
the problem is solved thanks dejan odabasic
Re: Libstock exclusive: FAT32 and Network Ethernet Libraries
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.
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.
If you know what you're doing, you're not learning anything.
Re: Libstock exclusive: FAT32 and Network Ethernet Libraries
wow, its really very helpful, thanks to mikroe team.
irfulabs
-
- Posts: 5
- Joined: 12 Mar 2014 13:02
Re: Libstock exclusive: FAT32 and Network Ethernet Libraries
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
thanks for the help
Re: Libstock exclusive: FAT32 and Network Ethernet Libraries
Hi,
I believe we have the same correspondence via e-mail, so lets please continue there.
Regards,
Filip.
I believe we have the same correspondence via e-mail, so lets please continue there.
Regards,
Filip.
-
- Posts: 5
- Joined: 12 Mar 2014 13:02
Re: Libstock exclusive: FAT32 and Network Ethernet Libraries
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
Hi,
I have sent you the requested project on the e-mail, please check your inbox.
Regards,
Filip.
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
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.
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.
- Attachments
-
- in this mode the runtime operation after the first write operation return error code=255.
- ko.JPG (35.37 KiB) Viewed 147001 times
-
- in this mode it's all well and the program write and no errors.
- ok.JPG (35.41 KiB) Viewed 147001 times
« Tutti gli esseri umani nascono liberi ed eguali in dignità e diritti.
Essi sono dotati di ragione e di coscienza e devono agire gli uni verso gli altri in spirito di fratellanza. »
Essi sono dotati di ragione e di coscienza e devono agire gli uni verso gli altri in spirito di fratellanza. »
- marina.petrovic
- Posts: 2986
- Joined: 18 Apr 2013 08:11
Re: Libstock exclusive: FAT32 and Network Ethernet Libraries
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
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
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
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