2020-12-23 02:50 AM
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.
Solved! Go to Solution.
2020-12-23 09:43 AM
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.
2020-12-23 09:43 AM
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.
2020-12-24 05:28 AM
thank you tesla delorean,
i will check.
2021-01-07 11:57 PM
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