各位牛人
我现在stm32f207上移植fatfs,但是挂载不上flash芯片,我的flash芯片型号为sst25vf016
返回FR_NO_FILESYSTEM的错误
跟踪到代码发现
/* Find an FAT partition on the drive. Supports only generic partitioning, FDISK and SFD. */
bsect = 0;
fmt = check_fs(fs, bsect); /* Load sector 0 and check if it is an FAT boot sector as SFD */
if (fmt == 1 || (!fmt && (LD2PT(vol)))) { /* Not an FAT boot sector or forced partition number */
UINT i;
DWORD br[4];
for (i = 0; i < 4; i++) { /* Get partition offset */
BYTE *pt = fs->win+MBR_Table + i * SZ_PTE;
br[i] = pt[4] ? LD_DWORD(&pt[8]) : 0;
}
i = LD2PT(vol); /* Partition number: 0:auto, 1-4:forced */
if (i) i--;
do { /* Find an FAT volume */
bsect = br[i];
fmt = bsect ? check_fs(fs, bsect) : 2; /* Check the partition */
} while (!LD2PT(vol) && fmt && ++i < 4);
}
printf("fmt = %d
",fmt);
if (fmt == 3) return FR_DISK_ERR; /* An error occured in the disk I/O layer */
if (fmt) return FR_NO_FILESYSTEM; /* No FAT volume is found */
这里出错,check_fs返回2
我是实验了原子官方的例程,也是返回FR_NO_FILESYSTEM的错误
谢谢了
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
我直接调用flash函数的进行读写是正常的啊
一周热门 更多>