cancel
Showing results for 
Search instead for 
Did you mean: 

SDIO microSD card f_mount returns FR_NOT_READY

JBond.1
Senior

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?

2 REPLIES 2

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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?