Code Size of Various SD Card/FAT32 Drivers
DavidZemon
Posts: 2,973
in Propeller 1
What kind of code sizes are folks looking at for write-capable SD card drivers on the Propeller? I'm only interested in ones running FAT32 drivers because the output needs to be (easily) legible on a computer, so no raw SD drivers. I'd like to log a bunch of data to an SD card in my balance bot software, but it's costing 12k to add PropWare's FatFileWriter and related classes.
My app is in C++, but I'm not at all opposed to converting Spin drivers via spin2cpp, so throw 'em all at me. Please tell me where the driver can be found, how much space it requires, and what model (Spin, PropGCC LMM, PropGCC CMM) gave that memory footprint.
My app is in C++, but I'm not at all opposed to converting Spin drivers via spin2cpp, so throw 'em all at me. Please tell me where the driver can be found, how much space it requires, and what model (Spin, PropGCC LMM, PropGCC CMM) gave that memory footprint.

Comments
.. MOUNT Mounted 1F35.313A-676E.3A3A mkfs.fat VSR FAT32 7,947MB (4,096/cluster) ok .. ls -l -rwxrwxrwx 1 502 500 1442886 Feb 22 12:57 P8X32A.PDF -rwxrwxrwx 1 502 500 3242394 Nov 7 13:26 POPCORN.WAV -rwxrwxrwx 1 502 500 3226652 Aug 30 07:27 WARPEACE.TXT -rwxrwxrwx 1 502 500 Jul 20 07:56 [code] -rwxrwxrwx 1 502 500 Jul 20 07:56 [HELP] . cd CODE .. ls -l -rwxrwxrwx 1 502 500 Jul 26 05:20 [.] -rwxrwxrwx 1 502 500 Jul 26 05:20 [..] -rwxrwxrwx 1 502 500 47346 Jul 18 13:32 EXTEND.FTH -rwxrwxrwx 1 502 500 4146 Jul 12 09:21 FLASH.FTH -rwxrwxrwx 1 502 500 42871 Jul 12 09:16 EASYNET.FTH -rwxrwxrwx 1 502 500 44012 Jul 12 09:16 EASYFILE.FTH -rwxrwxrwx 1 502 500 3520 Jul 6 09:17 COMPACT.FTH .. fopen FLASH.FTH ...opened at 0000.BB2A for 4146 .. 0 $80 FS DUMP 0000.0000: 54 41 43 48 59 4F 4E 20 56 34 20 28 20 56 34 2E TACHYON V4 ( V4. 0000.0010: 35 20 29 0A 0A 49 46 44 45 46 20 46 4C 41 53 48 5 )..IFDEF FLASH 0000.0020: 2E 66 74 68 0A 46 4F 52 47 45 54 20 46 4C 41 53 .fth.FORGET FLAS 0000.0030: 48 2E 66 74 68 0A 7D 0A 0A 70 75 62 20 46 4C 41 H.fth.}..pub FLA 0000.0040: 53 48 2E 66 74 68 09 09 09 50 52 49 4E 54 22 20 SH.fth...PRINT" 0000.0050: 53 65 72 69 61 6C 20 46 6C 61 73 68 20 64 72 69 Serial Flash dri 0000.0060: 76 65 72 20 31 37 30 36 32 30 2D 30 30 30 30 20 ver 170620-0000 0000.0070: 22 20 3B 0A 0A 0A 7B 0A 53 65 72 69 61 6C 20 46 " ;...{.Serial FIt has a very fast PASM block diver with read ahead and write behind support.
Kye's Fat_engine is the completest FAT32 driver, but is also quite big,
That are the two choices in Spin.
Mike
Searches for a filename, opens and loads into hub ram, and restarts/reboots this code.
Compiled with homespun (think this removes unused routines) results in a 10KB file/hub.
That is certainly darned impressive.
Any idea on code size for fsrw?
Sounds like Kye's engine is on the same order of magnitude as mine. Maybe +/- 10 or 20%. @Cluso99, did I understand correctly that your 10kB test did not include file write?
https://sourceforge.net/p/fsrw/code/ci/default/tree/csource/fsrw.c
That's awesome! well done
Last night I was looking in avrfreaks and they have boot code that is much smaller. IIRC about 2KB.
FWIW I have never tried to make a small boot code.
I decided to list the breakdown of the size of each routine and wrote a quick bit of code to list all the relevant routines and their code sizes. One of the largest routines is MOUNT at 138 code bytes but that also includes system messages. Some functions can be inferred from their names, certainly FOPEN RENAME etc and some other functions are simply runtime utilities such as setting the pins to be used for the SD card such as SDPSIN for configuring a Spinneret for instance since there is no need to specify any of this at compile time.