cancel
Showing results for 
Search instead for 
Did you mean: 

Driver to use MicroSD card with SPI

ronandouguet
Associate II
Posted on March 07, 2012 at 11:12

Hi,

I develop a project on the STM32F4 discovery board and I want use a MicroSD card. I work with Atollic TrueStudio for STM32.

So I search a driver to use my MicroSD card with SPI. I have an API to FATFs and an API to configure the SPI module but I haven't the driver to use MicroSD card.

My goal is to achieve a datalogger.

Thanks for your help.
23 REPLIES 23
ronandouguet
Associate II
Posted on July 26, 2012 at 17:00

Hi,

Here are my

files

that I use to

read

and

write

to an SD card

.

microsd_spi.c : configure the SPI connection with the SD card.

FileUtils.c : function CreateFile, Writefile....

ff.c :FatFs - FAT file system module

Good luck,

Ronan.

________________

Attachments :

diskio.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I02O&d=%2Fa%2F0X0000000bSc%2FUcTYHeElZjblA01zJ8c0gMgI8PUFnvqU_7_y7_rNLpA&asPdf=false

ff.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzxF&d=%2Fa%2F0X0000000bSd%2F2ChfRw1.Fi8NpunfpYJmQRV8zYq.iBdyLvg7jCfUaHg&asPdf=false

ff.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I02J&d=%2Fa%2F0X0000000bSa%2F6V3oekeTjFKPjTVxKsdJ8nr1OwiTe1SoR2ph8Jc99ZQ&asPdf=false

FileUtils.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I02E&d=%2Fa%2F0X0000000bSW%2Fh1bWZQQYh28bMYtlUvkXs7czdCK93liHzFpThncqcGM&asPdf=false

FileUtils.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzrR&d=%2Fa%2F0X0000000bSY%2FdHzmtsKRxnLGUiZ9IMgV3zHf3K77wVMtyn15VGatF9o&asPdf=false

integer.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I029&d=%2Fa%2F0X0000000bSV%2FclRbCIeXGWUtqhuKhLejPgJGDZVK15uLBx2p0rYVuPo&asPdf=false

microsd_spi.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I024&d=%2Fa%2F0X0000000bSU%2FS5E8BQjNSHA.u6WKyREFly7W7RpsjUrG3LAXXLdU6B8&asPdf=false

microsd_spi.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I01R&d=%2Fa%2F0X0000000bSX%2FQ6Lmgx7HFNwnGJIqxV5sOyuz_jnEesGztylB6BgSXnw&asPdf=false
rishi
Associate II
Posted on July 26, 2012 at 19:27

@ ronan.... thanks for the files...bro in which IDE  have you used for creating your project..??

you have not posted the main.c file... i am getting some error..so if possible can you upload your complete project or atleast complete files..so that i can try...or you can mail me also

rishi.iitk@gmail.com

thanks.

rishi
Associate II
Posted on July 30, 2012 at 12:02

can anyone suggest me what will be the main.c file for this datalogger....

cagibomber
Associate II
Posted on August 04, 2012 at 17:47

Hi Ronan, 

Thanks a lot for you post.

I'm plugging a SD-Card slot on my STM32f4 discovery.

Could you send my your headers for me to try your code ?

my mail is: cagibomber@hotmail.fr

Thank you again !

Mick