Hello dear friends
i use fopen , fclose and other function without any problem
but when i use fformat("M:SD_CARD /FAT32) or ("M:SD_CARD /WIPE)
it makes my SD card's format corrupts ! and i cant use my sd card until format it by windows . my driver is "MCI_LPC17x_8x" so way other functions work fine but this function is not?
thank for help
I use the following in my code to format the SD card that is placed in the system and I dont have a problem.
lSerialNumber = hw_GetOTRSerialNo(); sprintf((char *)&baBuffer[0],"M0:SFR%d /FAT32",lSerialNumber); (void) fformat ((const char *)&baBuffer[0]);
I would suggest you look a the heap size ( you need approximately 700 bytes per each file that is open for the flash Fs
its in the documentation but its easy to miss ( I dont work with the philips micros so cant tell you what to adjust in the startup.s file)
But you're complaining about formatting, not file writing. I'm suggesting you review the abstraction below the file system, about what it's putting on the media. ie file system structures, sectors/blocks and clusters.
If you don't understand the underlying file system, and it's structure well enough, perhaps you need to find some on who does, and can debug the situation for you.
You should be able to read blocks from the media using functions in the library supporting your device.
Thanks
" You should look at what your SD sector writing code is doing"
what should have been written?
"is this working properly, is the data being written appropriate"
if you mean writing a file , yes i wrote a file appropriately
"Examine the structure on the card"
sorry but how should i do it ?
"What size SD card is this"
2 GB
You should look at what your SD sector writing code is doing, is this working properly, is the data being written appropriate. Examine the structure on the card.
What size SD card is this? Is it >2GB SDHC card, does the driver support this properly?
If you think there is a problem with the library you should contact your support representative a Keil.
thanks for links but they aren't related to my problem !
View all questions in Keil forum