SD-MMC-Fat Engine object equvalent for P2?
wmosscrop
Posts: 409
in Propeller 2
Is there a P2 equivalent for, or has someone converted, this P1 object? Searching the forums finds some information on the monitor having limited SD functionality, probably not enough for my needs.
I need the ability to read/write/create/destroy multiple concurrent files and directories. Concurrent is the key here, I have at least 3 files open at once in a single cog.
Walter
I need the ability to read/write/create/destroy multiple concurrent files and directories. Concurrent is the key here, I have at least 3 files open at once in a single cog.
Walter
Comments
What language(s) and tools do you plan to use? I used the popular C FatFs code for micros to build the SD card flashing code for FlexGUI. The source code is distributed with flexgui, in board/sdcard/. The low level code is in ff.c and diskio,c, and the sample program is sdboot.c. The C code should be pretty portable to any P2 C compiler, including fastspin. If you're using FlexGUI and/or fastspin you can of course call this from any of fastspin's supported languages.
Spin2 and PNut for now, thanks.
Need to look at that now that @manatwork figured out how to mix in c...
Does this need its own cog? I was hoping for something that didn’t need a cog...
ff.c does not need its own cog.
I'm working on integrating the SD card reading into the standard C library, which will make using ff.c much easier. That may take a little while, so for now you'll need to call the various f_read, f_write, etc. routines directly. sdboot.c has some examples of how to do that.
Another option might be to dig up FSRW.c I remember seeing it in the forum eons ago...
But, if there's a standard C thing, maybe that's better...
Can it do concurrent file I/O ? I.e., open multiple files at once?
I still need a translation to P2 for spin2 for the FATEngine object. I don't seem to be able to find anything on this forum on this.
Again, multiple files open at a time is a requirement.
Thanks,
Walter
Don't think I've tried it yet though...
Note I stripped out the read csd and cid as they aren’t really necessary unless you’re swapping sd cards live.
Sorry I’m not on my pc atm.
forums.parallax.com/discussion/171642/p2-sd-drivers-cog-pasm-version-v-223/p1?new=1
http://forums.parallax.com/discussion/171600/propeller-2-os-its-alive
I'm still working on a number of things so nothing is tidy yet, but the basics are there and working.
(1)
I have a old 512MB card and a brand-new 32GB card. The 512MB card is generic, the 32GB card is SanDisk (retail packaged).
Both cards have the same contents.
I can run a program from PNut (v34r) with the 512MB card mounted, no issues (program does not try to access the card...yet, just verifying that I can access the P2).
When I try to run it with the 32GB card mounted, PNut can't find the P2 ("no hardware found..."). If I set the FLASH switch "on", then it can find the chip and load it.
Is this a requirement for large capacity cards or is there an issue with the new card?
Somewhere around here I have an 8GB card. Where, oh where, it is, nobody knows. If I find it I'll see what it does.
(2)
I can't compile _FAT32 from _FAT32_V217.zip, it refers to 3 objects not in the zip file:
... but I still can't compile _FAT32 as I'm missing the 3 objects.