2021-08-21 02:02 PM
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:My project SDIO configuration:SD 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?
2021-08-21 04:37 PM
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
2021-08-22 02:22 AM
Interestingly setting SDIO pins (except SDIO_CK) to pull-up according to this post worked:
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?