PDA

View Full Version : SDFS3 / SDFS32 , formattingan SD card from PIC



comwarrior
- 13th July 2012, 20:21
I was running the free space checker and it came back as 0KB... Theis card should be 512MB and it have a full format under windows prior to being modified.
Their is no macro or function for formatting the SD card, so how do you do it from a PIC?

Thanks

mackrackit
- 14th July 2012, 10:03
The only way I know to "format" using SDFS is to read the card using FSInt, then loop through removing each file with FSRemove.

comwarrior
- 14th July 2012, 16:15
hi mack,
I've set up a sub to rear the first FAT sector, zero it and write it back to the card.
However, it reads the fat sector back and it's all zero's, but when i turn it off and then back on again the same 'data' is their.
But the data that is their seems to be random? it's not file names...
Anoyingly, some of the charecters returned reconfigue my LCD in a manner that makes it do weird things... lol

Also, i modified a 64MB card and somehow SDFS init is reporting that it's FAT12... i'm not sure how windows managed to do that, but suffice it to say SDFS/SDFS32 won't mount the card now... could do with knowing where the 'format code' is located so that i can 'try' to change it...