Maximum File Size on SD Card and File Handling


Author Message
stef123
Regular Member

Joined: 25/09/2024
Location: United Kingdom
Posts: 89
Posted: 07:45am 30 Oct 2024      

Hi,

i´ve implemented for my Webmite-program a subroutine, which is called each two seconds by a timer, in order to write some Log Data to a File on SD Card, which is periodically opened in "append" mode.

Some Data is written (approx 20 Bytes), after that the File I/O Buffer is flushed in order to be sure that no data gets lost and the file is finally closed.

Now, after the log File has reached a Size of 8339454 Bytes, i cannot write into this file any longer.

Is this a general PicoMite File Size limit, or could it be that the FAT-Routines now consume too much time in order to find the end of the File and append some data? Is the PicoMite / are the FAT Routines in append mode in need to crawl through the entire file before some Data can be added - by following the clusters and read in the Data for each Cluster- or do the Fat routines seek for the last Cluster of the File in question and read it in?


The next problem is reading the Log File from SD card over TFTP after the Pico has been restarted. Issuing a "tftp -i xx.xx.xx.xx get b:/log.txt" gives an empty file, although the Pico says "TFTP request to read binary file : b:/log.txt" and ends with "TFTP transmit complete" - but with no Data transmitted at all.

The file can be only read entirely when the drive is changed from A to B by issuing "B:" on the command line. Is there any workaround for this behaviour?


Thanks & Best regards
Stef
Edited 2024-10-30 17:46 by stef123