cancel
Showing results for 
Search instead for 
Did you mean: 

ST32f407vgt6 sdcard fatfs problem

kustov2000
Associate
Posted on December 01, 2014 at 22:45

STM32F4CUBEMX 4.5.0

FIRmware 1.3.0

in the mode  hsd.Init.BusWide = SDIO_BUS_WIDE_1B; everything works well 

but in mode   hsd.Init.BusWide = SDIO_BUS_WIDE_4B;

retSD = FATFS_LinkDriver(&SD_Driver, SD_Path);    -  RES_OK = 0

retSD = f_mount(&diskF, (TCHAR const*)SD_Path, 0); -  RES_OK = 0

         

retSD = f_open(&MyFile, ''STM32.TXT'', FA_CREATE_ALWAYS | FA_WRITE);  -  RES_NOTRDY = 3

did anybody faced such problem before??

Any help is greatly appreciated!
2 REPLIES 2
Posted on December 10, 2014 at 18:44

Hi,

The 4-bit SD Data Transfer Mode is Mandatory for High-Speed Cards, Optional forLow-Speed ones, so it depends on the used uSD card type. Otherwise, it's better to configure first the 1-bit SD Data Transfer Mode:

hsd.Init.BusWide = SDIO_BUS_WIDE_1B;

And then, justenable wide operation, for the4-bit SD Data Transfer Mode:

HAL_SD_WideBusOperation_Config(&hsd, SDIO_BUS_WIDE_4B);

PS: You can refer to thestm324x9i_eval_sd.c/stm324xg_eval_sd.c BSP drivers, that may help you! Regards, Heisenberg.
Posted on December 11, 2014 at 15:04

Here below some screen captures from the RM0090 reference manual:

0690X00000602w7QAA.jpg

0690X00000602w8QAA.jpg

Regards,

Heisenberg.