cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103C8T6 SD Card Interfacing, Read/Write Files using SPI

JPanc.1
Associate II

I have STM32F103C8T6 and 16GB SD Card

I want to read/write files on SD card using SPI communication but not know where to start.

I am working with SD card first time.

Please anybody help me with this.

I am using STM32CubeMX and TrueSTUDIO

4 REPLIES 4

The nucleo boards have an SPI example using a driver in the AdaFruit shield code.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Can I make .txt file on SD card using this example??

Can you make a text file on a PC with fopen, fwrite, fclose, etc? FATFS provides similar interfacing.

The code talks to the SD Card

STM32Cube_FW_F1_Vx.y.z\Drivers\BSP\Adafruit_Shield\stm32_adafruit_sd.c

There are SPI drivers in the board file

STM32Cube_FW_F1_Vx.y.z\Drivers\BSP\STM32F1xx_Nucleo\stm32f1xx_nucleo.c

Look under the Nucleo examples for a FATFS one.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Yes I can make text file using C on PC