Re: FATS f_getfree 0 clusters
Posted: Sat Jan 17, 2015 2:44 pm
- sdcStart is void, so no return value
- sdcConnect CH_SUCCESS
- f_mount FR_OK
- f_getfree FR_DISK_ERR
- sdcConnect CH_SUCCESS
- f_mount FR_OK
- f_getfree FR_DISK_ERR
Code: Select all
sdcStart(&SDCD1, NULL);
if( sdcConnect(SDCDriver *sdcp) == CH_SUCCESS ){
FRESULT res = f_mount(&SDC_FS, "0:", 1);
if(res == FR_OK ){
chprintf(chp, "mounted succesfully\n");
}else{
chprintf(chp, "mounting failed\n");
}
}else{
chprintf(chp, "sdcConnect failed\n");
}
fastlink30 wrote:at the moment i do:
FATFS *fs2;
FATFS **fsp;
.....
fs2=(FATFS *)&SDC_FS;
*fsp=fs2;
chprintf(chp, "Mount filesystem... ");
chThdSleepMilliseconds(100);
err = f_getfree("/", &clusters, fsp);
ok, brutal, but like this seems correct, inside f_getfree() is called check_fs() wich return 2 (record signature not found)=> FR_NO_FILESYSYEM
... ach!
Code: Select all
FATFS *fs2;
FATFS **fsp;
fs2=(FATFS *)&SDC_FS;
fsp=&fs2; // NOT *fsp=fs2;