Skip to main content
ivan239955_stm1_stmicro_com
Associate III
January 16, 2015
Question

SD Card with STM32F405 and STMCube SDIO driver does not work in 4-bit mode

  • January 16, 2015
  • 2 replies
  • 569 views
Posted on January 16, 2015 at 13:27

Hello,

I have double checked all connections of SD card socket to uC on our board. We also have pull-up resistors there.

Required setting of 4-bit access can be seen in the SDIO_CLKCR.WIDBUS register during debugging but function disk_initialize called in f_mount retutns FR_NOT_READY.

Any opinion?

However, it is suspicious that I had to increase the SCLK divider to low the SCLK frequency for a reliable work (in 1-bit mode).

Regards

Ivan

    This topic has been closed for replies.

    2 replies

    Montassar BEN ROMDHANE_O
    Visitor II
    January 19, 2015
    Posted on January 19, 2015 at 10:03

    Hi Ivan,

    The 4-bit SD Data Transfer Mode is Mandatory for High-Speed Cards, Optional for Low-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, just enable wide operation, for the 4-bit SD Data Transfer Mode:

    HAL_SD_WideBusOperation_Config(&hsd, SDIO_BUS_WIDE_4B);

    0690X00000602x0QAA.jpg 0690X00000602tXQAQ.jpg PS: You can refer to the stm324x9i_eval_sd.c/stm324xg_eval_sd.c BSP drivers, that may help you! Regards, Heisenberg.
    ivan239955_stm1_stmicro_com
    Associate III
    January 26, 2015
    Posted on January 26, 2015 at 18:58

    Hello Heisenberg,

    Late setting of 4-bit mode works (I checked it by scope on SD Card signal D3) but the function

    HAL_SD_WideBusOperation_Config

    has to be called even after

    f_mount

    . Unfortunatelly, the file write still does not work reliably due to an interrupt (another issue). Regards Ivan