Multiple SD Card Mounts
BTL24
Posts: 54
Is it possible to mount more than one SD card with the propeller and using GCC libraries? Then access that card with file pointer functions separately in different cogs?
Example of Mount command...
sd_mount(DO, CLK, DI, CS); // Mount SD card...where the 4 pins are used for clock, data, etc.
I don't see a parameter that lets me annotate more than one SD card mount at a time.
Regards,
BTL24 (Brian)
Example of Mount command...
sd_mount(DO, CLK, DI, CS); // Mount SD card...where the 4 pins are used for clock, data, etc.
I don't see a parameter that lets me annotate more than one SD card mount at a time.
Regards,
BTL24 (Brian)
Comments
Thanks Swimdude. No rush...but yes, I would be interested in the propware approach. You can post results here...if you like.
Regards,
BTL24 (Brian)
Okay - glad to hear you're not in a rush lol. Give me a week's notice if you find yourself starting to get impatient - the SD driver is by far the most complicated bit of code that I've written in PropWare.
Do you have speed requirements? Everyone else's SPI drivers run at ~4MHz; PropWare's is still stuck at ~900 kHz. If full speed is equally important, that'll be another few days to work out the kinks in that - otherwise I'll tackle SD first and SPI down the road.
You might try the SD class in PropWare release-2.0 (avoid nightly in this case) and let me know (in the PropWare thread) if it works. I've had mixed results, but I think that may have been due to incompatible SD cards, not broken code. I'm very curious to hear your results.
Cheers,
David
PropWare's SD classes are coming right along! Currently, only read access has been implemented - but it's there and it works. Flushing out some further functionality (like tell, seek, and other helpers) will come tomorrow.
You should be good-to-go on multiple SD cards being read simultaneously from different cogs. If you try this (or anyone else reading), be sure to create new instances of the SPI class - don't use SPI::get_instance(). SPI is not thread-safe, so you need a unique instance on each cog that is using it (or you need to write your own locking mechanism around it).
Cheers,
David
You could use that object to mount additional SD cards using FSRW's interface...
Yes, it has. That is what libpropeller uses.