I'd like to use an SD card as a simple (large) eeprom chip. Can I use the basic init, erase, readblock and writeblock functions to store data in absolute block locations on an SD card (sorta kinda seting up my own file system actually)? Sure this will destroy the FAT format on the card (but it can always be reformated on a PC). My application would need to store firmware and setup data for a serial connected slave processor and I would store this on the SD card. Replacement firmware would be sent via a separate serial link to my app which would write it on the card. I'd pick absolute block numbers as to where I'd store the firmware and setup data. I wouldn't need the extra code to support the FAT file system (save flash space for my app). Sure there are advantages to using the fat file system, but the SD card would never be removed from my device (unless it fails) so it would only be used as a large serial eeprom. I was thinking of this because the 2.2" LCD display I'm using already has the SD card socket on it. Otherwise I'd use an (smaller) I2C or SPI 8 pin eeprom.
Also, duh, I completely failed to mention doing raw SD block reads & writes when I was testing the CRC16 addition to the SD library. So yes, it's entirely absolutely possible with the library, and yes, will nuke any filesystem on the card.
Still recovering from Maker Faire, mental function not yet at 100%.
pburgess wrote:So yes, it's entirely absolutely possible with the library, and yes, will nuke any filesystem on the card.
That sounds good. If I only use the raw read/write functions I can probbly leave out alot of code including the fat library functions. I don't care if I nuke the filesystem so long as it's possible to reformat the card on a card reader plugged into a PC running Linux or Windows. The only problem I see is finding a small micro SD card since for my needs even a 512K card would be way overkill. Certainly DON'T need an SDHC type!