我遇到了这个问题:我正在使用FAT FS和LPC4088,在我将物理驱动器与f_fdisk分开后,安装两个分区显然没有问题(我得到FR_OK作为每个使用过的fs函数的结果值),然后我创建了一个文件,我在上面写,然后关闭它,始终使用FR_OK结果值。然后我检查文件,我得到一个FR_NO_FILE错误 代码看起来像这样
static FILINFO fno;
static FIL fdst;
static DWORD plist[] = {50, 50, 0, 0};
FRESULT rc;
char error;
static BYTE work[512];
error = 0;
rc = f_fdisk(0, plist, work); /* Divide physical drive 0 */
/* rc=FR_OK */
rc = f_mount(&FS1, "0:", 1); /* Register work area to the logical drive 0 */
if (rc!=FR_OK)
{
rc = f_mkfs("0:", 0, 0);
}
rc = f_mount(&FS2, "1:", 1); /* Register a work area to the logical drive 1 */
if (rc!=FR_OK)
{
rc = f_mkfs("1:", 0, 0);
}
rc = f_open(&fdst, "0:myfile.bin", FA_WRITE | FA_CREATE_ALWAYS);
if (rc!=FR_OK) error =1; /* rc=FR_OK */
rc = f_write(&fdst,"abcde",5,&nwritten);
if (rc!=FR_OK) error =2; /* rc=FR_OK */
rc = f_close(&fdst);
if (rc!=FR_OK) error =2; /* rc=FR_OK */
rc = f_stat("0:myfile.bin", &fno);
if (rc!=FR_OK) error =4; /*rc = FR_NO_FILE*/
任何建议都将非常感激。