Assembly-less SD card reader?
Rayman
Posts: 14,665
Is there a built-in way to get SD card access without using a cog for a driver?
I'd like to read from SD with my DE0-nano P2 emulator, but only have one cog...
I found the FSRW C source code, but that was only for frsw.spin, not for the block driver...
Or, does anybody know of a SPIN only SD card code (without assembly driver)?
I'd like to read from SD with my DE0-nano P2 emulator, but only have one cog...
I found the FSRW C source code, but that was only for frsw.spin, not for the block driver...
Or, does anybody know of a SPIN only SD card code (without assembly driver)?
Comments
It can't be done with my DE0, either!! :0)
I guess I should have given you a real answer. No, there is no way currently to access an SD card using a single COG. It would, of course, be possible. You'd probably have to use -mxmmc and put your low-level block code in HUBTEXT.
If you want an ASM-less SD card driver, you should be able to replace the file system device _FileDriver with your new version _FileDriver2 in the driver list. Copy the existing lib files to make a new library, change them and replace the driver.
Look for _FileDriver (add _FileDriver2) and mount here:
https://code.google.com/p/propgcc/source/browse/lib/drivers/FileDriver.c?name=p2test
There are more files to consider, but you would end up replacing this: https://code.google.com/p/propgcc/source/browse/lib/drivers/load_sd_driver.c?name=p2test
I wish the package was a simple library, but as is it's woven into the stdio library fabric. Fortunately Eric gave us a reasonable way (reasonable to me at least) for replacing stdio devices.
That might work with spin2cpp... guessing it can't do SDHC, but that's OK for now...