cancel
Showing results for 
Search instead for 
Did you mean: 

How to merge SD card interface by SPI with FatFs middleware. in STM32F103C8T6. in Keil IDE.

VTaya
Associate II

Hello Vaibhav here.

I am interfacing SD card by SPI protocol with STM32F103C8T6 microcontroller.

My aim is to write data with  .txt   file in SD card.

I have enable the option for FatFs middleware from CubeMX but do not have any idea about how to merge SD card initialized by SPI protocol with FatFs middleware.

Sample code for the same would be highly appreciated.

Just in need of some simple code for operations like    1) write to SD card with "Example.txt" file name.

                                               2) Read from SD card with "Example.txt" file name. etc. etc.

Please resolve the above mention issue as soon as possible as i have dead line to submit my work .

Eagerly waiting for positive response.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------NOTE: Configuration tool --> CubeMX32

      Coding IDE       --> uVision Keil V5.25.2.0

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Thank you. 

3 REPLIES 3
Khouloud ZEMMELI
ST Employee

Thank you for giving your valuable time.

Ill take a look, hope it would be helpful.

VTaya
Associate II

The last link https://github.com/eziya/STM32_SPI_SDCARD is more of helpful but still couldn't get code work.

if its possible for you, please provide SD card code for STM32f103C8T6 micro controller , interfaced by SPI1 protocol and taking middle-ware FatFs into consideration.

also _Error_Handel(_file,_Line_); is undefined. I have changed it according to updated version of CubeMX which is Error_Handel(); function. As a matter of fact that function is empty.

so still the part "_File" and "_Line_" in error handel function is unknown .

any help would be really appreciated.

Thank you.