2020-10-23 12:45 AM
Hi, i have stm32f446ze on my custom pcb.
Pin details :
PC8 SDIO_D0
PC9 SDIO_D1
PC10 SDIO_D2
PC11 SDIO_D3
PC12 SDIO_CK
PD2 SDIO_CMD
Global interrupts enabled and no DMA. i tried with Cubemx version 6.0.1, 4.25.0, 4.26.0. but whole the time , f_mount gave fr_not_ready.
What i tried to achieve this problem ?
Increase stack size
i tried to different versions of cubemx
Pull-up configuration
Different sd card
Another teammate of me who work same hardware last year. it worked but he took the fatfs by generated different version of cubemx and migrate to project which generated different version of cubemx. This is why no hardware related problem.
Now, how can i handle the problem ?
Best Regards
2020-10-23 12:59 AM
Dig into the DISKIO code, instrument if necessary. Not ready suggests it might be looking at the state of a card present pin flagging if a card is in the socket.
SDIO on the F4 needs the PLL running
2020-10-23 01:15 AM
PG5 is the Detect_SDIO pin and i configured as input from Fatfs Configuration window.
Also PLL enabled.
it returns from here :
stat = disk_initialize(fs->drv); /* Initialize the physical drive */
if (stat & STA_NOINIT) { /* Check if the initialization succeeded */
return FR_NOT_READY; /* Failed to initialize due to no medium or hard error */
}
2020-10-23 01:36 AM
Yeah, so you're going to need to descend into DISKIO layer to see why the initialization failed, or if it determined the card was missing.
2023-10-13 02:45 PM
Did you find the source of the problem? I have same issue. I tried your solvings that you tried. It did not work.
2023-10-13 04:29 PM
If you have a pin committed to the CARD DETECT or similar pin, the pin needs to be wired, the pin needs properly initialized.
The DISKIO code layer is where it's checking the pin and setting the STA_NOINIT flag, search in the sd_diskio.c (or equivalent file) for that text. Typically where it checks for a pin, or fails to initialize.
2023-11-10 08:26 PM
The FR_NOT_READY error typically indicates that the physical drive cannot be initialized due to no medium or a hard error. This could be due to a variety of reasons such as incorrect wiring, incorrect SDIO configuration, or an issue with the SD card itself.
Based on the information provided, it seems that you have already checked the wiring and tried different SD cards, which is a good start. Here are a few additional steps you could take:
Here is a code snippet that might be helpful:
FATFS SDFatFs; /* File system object for SD card logical drive */ FIL MyFile; /* File object */ char SDPath[4]; /* SD card logical drive path */
...
/* Register the file system object to the FatFs module */ if(f_mount(&SDFatFs, (TCHAR const*)SDPath, 0) != FR_OK) { /* FatFs Initialization Error */ Error_Handler(); } else { /* FatFs Initialization successful */ ... }
This code snippet attempts to mount the SD card and checks if the operation was successful. If not, it calls an error handler function.