SD2.0 Full FAT32/16 File Sytem Driver - You there! Yes you, viewing this forum.
Kye
Posts: 2,200
Hey everybody,
I’ve think I’ve finally got a working release of the file system driver that I’ve been coding for about a year now. So, meet the SD2.0· FATEngine, a fully functional FAT32 and FAT16 file system driver that supports SD cards and ·MMC cards (kinda). The driver supports accessing files and directories across a SD card. So, no longer will you be limited to the root directory. By using the FATEngine you can now read and write to files in any directory on the SD card. Included with this are also the abilities to change your working directory, rename files and folders, change file and folder attributes, and delete files and empty folders. Additionally file and folder creation is supported so that your application can build any directory structure it needs. Last but not least, the file system support full directory listing capabilities so that you can query information about all the files and directories on the SD card.
So, to keep this post short I recommend you read through the driver which is attached and try out the EXTENSIVE included demo which will function as a serial interface into your SD card. Simply open the SD2.0 FATDemo file up and configure the constants correctly. After doing so load the demo on your prop chip and type in “help”, followed by enter, to see the command list which gives all the allowed command names and arguments for those commands in the demo. If you have some wav files and audio hardware on your board please check out the “play” and “record” commands which can play and record wav files – they are especially nice. Also, remember to use the "mount" command first to mount the SD card so that you can acess the file system.
Anyway, I would like to ask that if you have a problem with the driver, please post online here about the problem so that I can work to fix it. I don’t know if the block driver supports every SD card out there but I’ve had no failures so far with any of my test cards. I would also like if you could post the results of the “test” command back on the forum if you do use the demo so that I can see what the average read and write speeds are for certain operations.
Thank you,
·(Going to bed now, will answer questions later at 10 or 11 am EST).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 6/4/2010 3:03:27 PM GMT
I’ve think I’ve finally got a working release of the file system driver that I’ve been coding for about a year now. So, meet the SD2.0· FATEngine, a fully functional FAT32 and FAT16 file system driver that supports SD cards and ·MMC cards (kinda). The driver supports accessing files and directories across a SD card. So, no longer will you be limited to the root directory. By using the FATEngine you can now read and write to files in any directory on the SD card. Included with this are also the abilities to change your working directory, rename files and folders, change file and folder attributes, and delete files and empty folders. Additionally file and folder creation is supported so that your application can build any directory structure it needs. Last but not least, the file system support full directory listing capabilities so that you can query information about all the files and directories on the SD card.
So, to keep this post short I recommend you read through the driver which is attached and try out the EXTENSIVE included demo which will function as a serial interface into your SD card. Simply open the SD2.0 FATDemo file up and configure the constants correctly. After doing so load the demo on your prop chip and type in “help”, followed by enter, to see the command list which gives all the allowed command names and arguments for those commands in the demo. If you have some wav files and audio hardware on your board please check out the “play” and “record” commands which can play and record wav files – they are especially nice. Also, remember to use the "mount" command first to mount the SD card so that you can acess the file system.
Anyway, I would like to ask that if you have a problem with the driver, please post online here about the problem so that I can work to fix it. I don’t know if the block driver supports every SD card out there but I’ve had no failures so far with any of my test cards. I would also like if you could post the results of the “test” command back on the forum if you do use the demo so that I can see what the average read and write speeds are for certain operations.
Thank you,
·(Going to bed now, will answer questions later at 10 or 11 am EST).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 6/4/2010 3:03:27 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
· Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
Just leave the clock pins in the constant section·unchanged. In this version I simply removed the abort statement for any clock I/O errors that happen. Invalid time stamps will be produced when this happens but·the driver will continue to work without a DS1307 RTC attached.
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 6/7/2010 2:23:04 AM GMT
Amongst all those unix commands shouldn't "mkfil" be "touch"?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Yesterday I was using the previous version and I noticed a problem with directory two chars long.
This is the sequence of instructions:
mount 0--> Ok
mkdir PO --> dir created
ls --> I can see the folder
cd PO --> Directory not found
From three chars up then there is no problem, everything works great!
I will test this driver for the same issue and I let you know.
The raw write speed for my driver isn't very high always, I've noticed that it can range from about 160KB a sec down to like 30KB depending on which card you use... I'm not sure why this happens.
The file system allocation write speed however is very slow when creating a new file. Because whenever you want a new cluster you have to read in a fat sector and then from there search for a free cluster. After finding one which could take multiple reads you then have to write out that cluster claiming that sector. Then you have to zero every byte in the·cluster over multiple sectors·and then read in the first·sector of that cluster... Finally after all that you can write to the file.
@nicolad76 - Just tested that and found no prolems. Just FYI, the previous version had a $&!^ ton of bugs...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 6/4/2010 2:14:17 PM GMT
1Gig ones are working too.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Post Edited (Dr_Acula) : 6/4/2010 2:46:17 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Why do you have to zero a new cluster? It's going to be written over anyway.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my new website!!
Use the Propeller icon!!
Follow me on Twitter! Search "Microcontrolled"
Bill
I tried this with a 1 GB HP SD card, it works great.· Here are the results:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the Propeller Powered SIG·fourm kindly hosted at Savage Circuits
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
Please keep the test results comming. I need to calculate an average. If no one has any problems I'll put the driver in the OBEX.
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 6/4/2010 6:34:57 PM GMT
2 Gig Lexar
My 2Gig Zap glider doesn't work though. [noparse]:([/noparse]
Anyone running @ 100 Mhz?
Jim
I'm running Base Pin 0 and getting mount failure.
Post Edited (hover1) : 6/4/2010 7:34:37 PM GMT
That said, even with 8.3 file names this is great code and thanks for your efforts.
Jim
U so smart
Will this work ok with big sd cards?
Like 8gb ones.....
It gets great read and write speeds. I have about 40 WAV files on the card across different directories and I can play all of them.
@Wurlitzer·- If I were to do that it really wouldn't be FAT16/32 compatible anymore. So, I really can't do that.
However, you could just make your files have their name stored as the first 256 bytes in the file.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (Kye) : 6/4/2010 8:18:46 PM GMT
Very nice Kye! Nice job on the entire suite! Can't wait to get a DS1307 now! (Should have been in my bins a long time ago).
Jim
I'm very impressed. Thanks for posting, I'll be looking for it on OBEX too.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Talbot
New Market, MD, USA
I'll be sure to post a couple different test cases with the SD cards I have on hand.
Good job Kye!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, P.E.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" 16:9 LCD Composite video display, eProto for SunSPOT, PropNET, PolkaDOT-51
www.tdswieter.com
The DAC Engine and the FAT Engine are all you need to play wav files. I also have the code necessary to do so in the function called "play".
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
I'm busy making your code jump through hoops. It works very well.
I just posted a long posting asking about bootloading.
I've just deleted that post. Because I found the "boot" command. And it works!!!!
This is awesome. Just what I needed.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Post Edited (Dr_Acula) : 6/5/2010 12:50:19 PM GMT
but
what we have is an operating system that boots up using local VGA and keyboard. I compiled Femtobasic into a binary and renamed it FBAS.BIN and put that on the sd card, then run the command
BOOT FBAS.BIN
and it boots into Femtobasic.
It is a little slower than propdos to copy the bytes over but only a couple of seconds.
This is a standalone operating system! Life is very good. Thanks kye.
Next step might be to print out all the binary files on bootup. And add the option propdos has where you don't have to type "boot" - if you just type the name of the file and it is a .bin file then it runs.
addit: I can post code if you like but it is a real mess.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller