2018-01-07 6:33 AM
I'm trying to connect to a2GB sd card class 6 with stm32f091cctx MCU via SPI. Using fatFs library ver. R0.13a I'm able to mount the drive and open the file with f_mount and f_open functions. But when it comes to reading from file, it just freezes somewhere in f_read function. Also when I try to change the position of pointer with f_lseek, again it freezes. f_lseek works only when I write it as f_lseek(&MyFile, 0).
This part of my code is as below:
if(FATFS_LinkDriver(&SD_Driver, SDPath) == 0)
{
f_mount(&SDFatFs, (TCHAR const*)SDPath, 1);
f_open(&MyFile, 'SAMPLE1.WAV', FA_READ);
f_lseek(&MyFile, 200);
f_read(&MyFile, rtext, 1000, (UINT*)&bytesread);
}�?�?�?�?�?�?�?
#stm32f0 #fatfs #sd-card #spi
2018-01-09 2:40 AM
Hello,
Please refer to the following discussions if you have similar issue:
-
https://community.st.com/0D50X00009bMM8bSAG
-
https://community.st.com/0D50X00009XkWyLSAV
Best Regards,
Imen.
2018-01-10 7:58 AM
thank you so much
2018-01-10 8:18 AM
Not sure how applicable SDIO implementation details are to SPI. Assume FatFs is solid and you need to focus on testing and validating your code in DISKIO.C and below.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.