cancel
Showing results for 
Search instead for 
Did you mean: 

SD card with fatfs on STM3210C-EVAL

luca2399
Associate II
Posted on November 05, 2014 at 11:50

Hello at all,

Somebody knows where can I take the fatfs library for SD card on STM32F107 MCU?

thank you

#stm32-stm3210c-sd-card-fatfs
3 REPLIES 3
Posted on November 05, 2014 at 17:05

The board level SD card stuff can be found here

STM32F10x_StdPeriph_Lib_V3.5.0\Utilities\STM32_EVAL\Common\stm32_eval_spi_sd.c

Reasonably generic DISKIO.C abstraction here

STM32L152-EVAL_FW_V1.2.0\Project\STM32L152-EVAL\src\diskio.c

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
luca2399
Associate II
Posted on November 07, 2014 at 15:32

Thanks for the reply, but i have still a problem.

I'm using the Diskio.c you mentioned and the stm3210c_eval_spi_sd.c as staff for SD card.

Moreover I'm using the FatFs library taken from STM3210C-EVAL_USB_Host_MSC example.

The problem is that, using a 16Gb uSD card (FAT32), when I call SD_Init() function execution hangs in an infinite loop inside this function. More in details, execution is not able to exit from SD_GoIdleState() function.

While if I use the 2Gb uSD card provided with the STM3210C kit (without file system, I think) i don't have the same problem?

Do you know why?

Thank you

Luca

Posted on November 07, 2014 at 16:56

Most of ST's SD Card examples use BYTE addressing, and 32-bit variables, this is not conducive to access >2GB. You'd need to modify it to use BLOCK addressing (512 byte sectors). Also SDHC cards have a slightly different command set than SD/MMC cards.

I've posted working examples (SDHC/SDXC up to 64 GB) for the STM32F4-DISCO board (FATFS and MSC).

I've worked on the F1 (103/107) with SD cards, but have moved on.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..