cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in Interfacing SD card to STM32f103ZET6 Development board

renukaradhya
Associate II
Posted on June 26, 2015 at 14:19

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. 

This discussion is locked. Please start a new topic to ask your question.
5 REPLIES 5
Posted on June 26, 2015 at 15:48

Use FatFs?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
renukaradhya
Associate II
Posted on June 27, 2015 at 06:42

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=false
Posted on June 27, 2015 at 07:20

What specifically is giving you an issue?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
renukaradhya
Associate II
Posted on June 27, 2015 at 08:02

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.

renukaradhya
Associate II
Posted on July 09, 2015 at 08:26

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.