cancel
Showing results for 
Search instead for 
Did you mean: 

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

LOGU
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

3 REPLIES 3

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

thank you tesla delorean,

i will check.

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen