NANDFLASH FATFS 格式化nandflash后,flash空间变小了很多,nand 是2Gb的,现在通过 f_getfree 得到的空间是15MB,
FATFS fs;
FIL fl;
FATFS *pfs;
DWORD clust;
unsigned int r,w,i;
FRESULT res;
//display_page(0,0);
res=f_mount(0,&fs);
printf("f_mount=%x \n\r",res);
// for format
res=f_mkfs(0,1,2048); //MUST Format for New NANDFLASH !!!
printf("f_mkfs=%x \n\r",res);
// for
pfs=&fs;
res = f_getfree("/", &clust, &pfs);
printf("f_getfree=%x \n\r",res);
printf("\n\r%lu MB total drive space." "\n\r%lu MB available.\n\r",(DWORD)(pfs- >max_clust - 2) * pfs->csize /2/1024,clust * pfs->csize /2/1024);
|