What is the writing limit on a SD card 8G

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

What is the writing limit on a SD card 8G

跳至解决方案
824 次查看
neilporven
Senior Contributor I

Hi everyone,

 

I am using FatFs 0.9b and I would like to know what is its limit?  I have a 8G SD card.

 

Thanks,

Neil

标签 (1)
0 项奖励
回复
1 解答
624 次查看
isaacavila
NXP Employee
NXP Employee

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

在原帖中查看解决方案

3 回复数
624 次查看
neilporven
Senior Contributor I

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

0 项奖励
回复
625 次查看
isaacavila
NXP Employee
NXP Employee

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

624 次查看
neilporven
Senior Contributor I

Thanks Isaacavila,

The f_getfree is what I was looking for, it helped me.

Neil

0 项奖励
回复