Skip to main content
Visitor II
December 23, 2020
Solved

Has anyone a working 1-bit SDIO FATFS example with STM32f207VE?

  • December 23, 2020
  • 1 reply
  • 1456 views

I would like to use SDIO with 1 bit mode with FatFS. I use STM32F207VE MCU. The SD card is a 16 GB SanDisk.

Version of STM32CubeMX is 6.1.1, firmware version is STM32Cube FW_F2 V1.9.2.

FATFS R0.11 version used.

When I generate SDIO with 1 bit mode it is not working. Function 'f_open' is returning with error code: 12 which is 'FR_NOT_ENABLED' and f_read return with error code 9, which is 'FR_INVALID_OBJECT'

// code

while(1)

{

retSD=f_mount(&SDFatFS, SDPath, 1);

HAL_Delay(20);

if(resSD == 0)

{

HAL_Delay(20);

retSD = f_open(&SDFile, "HL.txt", FA_READ);

HAL_Delay(200);

retSD = f_read(&SDFile, array,sizeof(array),bytesread);

HAL_Delay(200);

f_close(&SDFile);

}

}

help me how can I solve this.

    This topic has been closed for replies.
    Best answer by Tesla DeLorean

    You could waste the best part of forever digging bugs out of machine generated code.

    I'd suggest this as a working basis for a port to your platform

    STM32Cube_FW_F2_V1.9.0\Projects\STM322xG_EVAL\Applications\FatFs\FatFs_uSD

    I'd also upgrade to more current FATFS that doesn't have the bugs in the ones ST distributes.

    Don't mount in a loop. Mount once. Validate the functionality of DISKIO routines.

    1 reply

    Graduate II
    December 23, 2020

    You could waste the best part of forever digging bugs out of machine generated code.

    I'd suggest this as a working basis for a port to your platform

    STM32Cube_FW_F2_V1.9.0\Projects\STM322xG_EVAL\Applications\FatFs\FatFs_uSD

    I'd also upgrade to more current FATFS that doesn't have the bugs in the ones ST distributes.

    Don't mount in a loop. Mount once. Validate the functionality of DISKIO routines.

    LOGUAuthor
    Visitor II
    December 24, 2020

    thank you tesla delorean,

    i will check.

    Technical Moderator
    January 8, 2021

    Hello @LOGU​ ,

    Do you have still this problem to solve?

    Did you follow the recommendation suggested by @Community member​ ? If his answer resolve your issue, please mark it as Best answer by clicking on "Select as Best".  This will help other users find this solution more quickly.

    Imen