STM32F401RE: failed to mound SDcard
Hello Everyone
I am using FATFS on STM32F401RE, with the code generated by CubeMX, which is version 6.12.0. When I perform the mount operation, the return value is FR_NOT_READY. However, initializing the SD card through the HAL library and reading SD card information using the HAL library are both normal operations. Therefore, the SD card is functioning correctly, and the circuitry between the SD card and STM32F401RE is also normal. So, how can I resolve the issue of not being able to mount the file system?
AND this is sdio config

TEST CODE:
printf("Micro SD Card Test...\r\n");
HAL_SD_Init(&hsd);
if(HAL_SD_GetCardState(&hsd) == HAL_SD_CARD_TRANSFER)
{
printf("Initialize SD card successfully!\r\n");
printf(" SD card information! \r\n");
printf(" CardCapacity : %llu \r\n", (unsigned long long)hsd.SdCard.BlockSize * hsd.SdCard.BlockNbr);
printf(" CardBlockSize : %ld \r\n", hsd.SdCard.BlockSize);
printf(" LogBlockNbr : %ld \r\n", hsd.SdCard.LogBlockNbr);
printf(" LogBlockSize : %ld \r\n", hsd.SdCard.LogBlockSize);
printf(" RCA : %ld \r\n", hsd.SdCard.RelCardAdd);
printf(" CardType : %ld \r\n", hsd.SdCard.CardType);
HAL_SD_CardCIDTypeDef sdcard_cid;
HAL_SD_GetCardCID(&hsd,&sdcard_cid);
printf(" ManufacturerID: %d \r\n",sdcard_cid.ManufacturerID);
}
else
{
printf("SD card init fail!\r\n" );
}
HAL_Delay(50);
FRESULT res = f_mount(&fs, "0:", 1);
if (res != FR_OK) {
printf("Mount Error ,err code: %d\n", res);
return 0;
} else {
printf("Mount OK \n");
}
RESULT

