I am trying to read and write to a class 10 - 2GB SD card from STM32 with the help of FATFS R0.11, but f_mount()
function is returning FR_NO_FILESYSTEM
error code. I have tested the same code on a class 4 - 2GB and class 10 - 16GB SD card, and it worked perfectly. What am I doing wrong here for this specific SD card?
Code:
FIL filTest;
FATFS fs;
FRESULT initSD()
{
disk_initialize(0);
FRESULT res;
res = f_mount(&fs, "", 1);
if(res != FR_OK)
{
return res;
}
res = f_open(&filTest, "test.txt", FA_OPEN_ALWAYS | FA_WRITE | FA_READ);
return res;
}