中级会员
 
- 积分
- 224
- 金钱
- 224
- 注册时间
- 2015-7-1
- 在线时间
- 2 小时
|

楼主 |
发表于 2015-8-20 13:13:10
|
显示全部楼层
回复【8楼】正点原子:
---------------------------------
我根据你们的实验39做了一个简单的测试:
以下是我修改的部分:
FATFS fs;
FIL file;
res = f_mount(&fs,"0:",1);
if(res != 0)
{
printf("f_mount failed.\r\n");
}
else
{
printf("f_mount successed.\r\n");
}
res = f_open(&file,"0:/data111.txt",FA_CREATE_NEW|FA_WRITE);
if(res != 0)
{
printf("f_open failed.\r\n");
}
else
{
printf("f_open successed.\r\n");
}
f_close(&file);
printf("FATFS OK!\r\n");
我没有申请内存分配,想直接创建一个TXT,在f_open的时候 res的返回值是非0,
printf("f_open failed.\r\n");
为什么会创建TXT失败呢???? |
|