Hello Neil,
Have you tried by using f_getfree API?
Here you can find more information: FatFs - f_getfree
And also, in host_msd_fatfs_bm_frdmk64f example (KSDK 1.3) this API is used to get the available space in the disk:
/* Get free clusters */
returnCode = f_getfree(_T("0:"), &fre_clust, &fs);
USB_PRINTF("%lu KB total disk space.\n\r%lu KB available.\n\r", (((fs->n_fatent - 2) * (fs->csize)) / 2), ((fre_clust * (fs->csize)) / 2));
I hope this can help!
Best Regards,
Isaac
Quick Update,
I filled the 8G SD card to max cap.
The only thing that could signal that I reached the end is that in f_lseek or f_open .... etc..... the first parameter FIL internal variables
fptr = fsize. Is it correct to assume once this condition is reached that the card is full?
Thanks,
Neil
Hello Neil,
Have you tried by using f_getfree API?
Here you can find more information: FatFs - f_getfree
And also, in host_msd_fatfs_bm_frdmk64f example (KSDK 1.3) this API is used to get the available space in the disk:
/* Get free clusters */
returnCode = f_getfree(_T("0:"), &fre_clust, &fs);
USB_PRINTF("%lu KB total disk space.\n\r%lu KB available.\n\r", (((fs->n_fatent - 2) * (fs->csize)) / 2), ((fre_clust * (fs->csize)) / 2));
I hope this can help!
Best Regards,
Isaac