2015-06-26 05:19 AM
Hi, i want to interface SD card to the STM32F103ZET6 controller, as i know we can interface using SDIO or SPI mode, SDIO is working fine i can read and write data to the SD card from array contains static data but i want to write .txt file data to the SD card, can anybody suggest me how to create, write and read data from text file to the SD card.
2015-06-26 06:48 AM
Use FatFs?
2015-06-26 09:42 PM
Thank you clive, i already gone through FATs but its little confusing can you help me out to overcome my problem, i have also attached some example codes can you please correct me where i'm doing mistake in it.
________________ Attachments : SD_Read_File_SPI_FAT32.rar : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hzu5&d=%2Fa%2F0X0000000bQy%2FCjalJaJYIn_pC6_b7YEkPVDQSTT3o.fhZv.NPx3WehQ&asPdf=false2015-06-26 10:20 PM
What specifically is giving you an issue?
2015-06-26 11:02 PM
actually i have two text files wangbao.txt and test.txt in project folder, when i try to open file to read or write using below snippet f_open returns FR_NOT_READY error code
res1 = f_open(&fdst, ''wangbao.txt'', FA_CREATE_ALWAYS | FA_WRITE); res = f_open(&fsrc, ''test.txt'', FA_OPEN_EXISTING | FA_READ);i think i have to create above said text files in SD cards it seems.2015-07-08 11:26 PM
Hi clive, I am facing problem in opening the file usign f_open, the error code is FR_NO_FILESYSTEM and it is due to No valid FAT patition is found, can you guide me how to resolve the above error successfully, I have already formatted my SD card twice as FAT32 file system.