Skip to main content
Graduate
August 21, 2021
Question

SDIO microSD card f_mount returns FR_NOT_READY

  • August 21, 2021
  • 1 reply
  • 3544 views

Hi, I have STM32F407VET6 board and trying to use FATFS and SDIO card slot, but f_mount returns FR_NOT_READY.

My project clock configuration:0693W00000Dq0ZBQAZ.pngMy project SDIO configuration:0693W00000Dq0ZvQAJ.pngSD card: Kingston 16GB microSDHC class 10 I1 SDCS.

I have tried to debug the f_mount and see where and what error is returned deeper. The error occurs in "HAL_SD_ConfigWideBusOperation" where "SD_HandleTypeDef" getsdifferent "ErrorCode":

0x00000002 // SDMMC_ERROR_DATA_CRC_FAIL Data block sent/received (CRC check failed)

0x00000006 // SDMMC_ERROR_CMD_RSP_TIMEOUT Command response timeout + above error

0x00001004 // SDMMC_ERROR_CMD_RSP_TIMEOUT + SDMMC_ERROR_COM_CRC_FAILED

I have read that SDIO should be configured at lower speeds so tried to set:

 hsd.Init.ClockDiv = 0; // = 3, 4, 200, 255

But still the same.

Any ideas what is the issue and how to solve this?

    This topic has been closed for replies.

    1 reply

    Graduate II
    August 21, 2021

    FR_NOT_READY often comes from either the GPIO indicating a card is in the socket, or querying the card state

    The F4 probably not going to be good in DIV1/BYPASS mode, would avoid use of Hardware Flow control

    Needs the PLL running to get a 48 MHz clocking source, typically divides that down by 2 to get the bus level clock to the cards.

    The PLL clock can get as high as 75 MHz in not using USB or CRYP/HASH

    JBond.1Author
    Graduate
    August 22, 2021

    Interestingly setting SDIO pins (except SDIO_CK) to pull-up according to this post worked:

    https://community.st.com/s/question/0D50X00009XkWceSAF/stm32f411re-stm32cube-fatfs-sdio-sdcard-always-returns-frdiskerr?t=1573717870396

    Tested only reading from SD card, did not test writing.

    But why does it work? And will writing work in such configuration?

    Is it proper solution to the problem or hack/workaround?