cancel
Showing results for 
Search instead for 
Did you mean: 

SDCard FATFS f_mount always succeeds

EthanMankins
Senior

I am using the STM32H7B3I-DK and followed How to create a file system on a SD card using STM32CubeIDE. I noticed that DMA options are not available on the SDMMC1 configuration tab, so I just skipped that step. The rest of the steps I followed. In FATFS Platform settings I set Detect_SDIO  GPIO:Input PI8.

I do not have a microSD card inserted but the f_mount() is still successful:

 

void SDInit(void)
{
    // Mount the file system on the SD card (assumes SDPath is defined)
    if (f_mount(&SDFatFS, (TCHAR const*)SDPath, 0) != FR_OK)
    {
        printf("Failed to mount\r\n");
    }
    else{
        printf("Mount Good\r\n");
    }
}

 

I have checked PI8 state and it is set which is correct for no device inserted, so I am unsure why f_mount() passes

1 ACCEPTED SOLUTION

Accepted Solutions
AScha.3
Chief III

It just seems successful, because you are using parameter 0, for delayed mount.

Try with parameter 1, for " mount now" and you will see, whether it can mount now - or not.

 

Btw,

I always use mount with "1" , because it's my first check for SD card okay : card is here, not defective, access seems good.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
AScha.3
Chief III

It just seems successful, because you are using parameter 0, for delayed mount.

Try with parameter 1, for " mount now" and you will see, whether it can mount now - or not.

 

Btw,

I always use mount with "1" , because it's my first check for SD card okay : card is here, not defective, access seems good.

If you feel a post has answered your question, please click "Accept as Solution".

Thanks for the heads up, that makes sense. Solved my issue