AnsweredAssumed Answered

SD card size problem

Question asked by Jan Malý on Jan 27, 2018
Latest reply on Feb 5, 2018 by Jan Malý

Hello,

 

I try to get size of SD card and I use:

 

DWORD tx;
FATFS *fs;
FRESULT res;

 

res = f_getfree("0:",&tx,&fs);

then 

MMC size:             (fs->n_fatent - 2) * fs->csize ) / 2 /1024

MMC free space:   (tx * fs->csize) / 2 /1024

 

Result:

MMC size:  7528

MMC free space: 7178

 

vs Real:

MMC size:  7708

MMC free space: 6789

 

the problem is, that (tx * fs->csize) / 2 /1024 returns only value 7178.

Can me sombody help?

 

Thank you

 

 

Outcomes