你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

FATFS0.12c到f_mount()卡死,求助

[复制链接]
dabendan001 提问时间:2019-5-26 11:55 /
本帖最后由 dabendan001 于 2019-5-26 12:18 编辑

STM32F105RC,使用FATFS 0.12正常。尝试将FATFS换成0.12C,每到 f_mount()时卡死,跟踪调试时,运行到 ff.c文件中 res = find_volume(&path, &fs, 0);        /* Force mounted the volume */,停止不前。卡在这里。再往下一步跟踪,死在这里:fmt = check_fs(fs, bsect);                        /* Load sector 0 and check if it is an FAT-VBR as SFD */
不知道如何下手处理了,请哪位来指点一下,谢谢。
res_flash = f_mount(&fs1_flash,"1:",1);                       //fs1_flash为全局变量,需要固定内存空间。
若将最后一个参数改为0,非即时挂载,到后面文件 f_open() 时卡死。
-------------------------------------

res_flash = f_mount(&fs1_flash,"1:",0);  //系统挂载         
    HAL_Delay(200);
    printf("\r\n FlashDisk mount completd...f_mount:%d.\r\n",res_flash);
    #if(1)  //仅用于测试
        if(flash_format)
        {
            flash_format = false;
            printf("\r\n FlashDisk will format...\r\n");
            res_flash = f_mkfs("1:",FM_FAT, 0, work, sizeof work);
            printf("\r\n FlashDisk format completed...f_mkfs:%d.\r\n",res_flash);
            
            /* 格式化后,先取消挂载 */
                        res_flash = f_mount(NULL,"1:",1);               
            printf("\r\n FlashDisk umount completed...\r\n");
            /* 重新挂载        */                        
                        res_flash = f_mount(&fs1_flash,"1:",1);                     //第3个参数为1时卡死
            printf("\r\n FlashDisk re-mount completed..%d.\r\n",res_flash);
            //HAL_Delay(200);
        }
    #endif






收藏 评论1 发布时间:2019-5-26 11:55

举报

1个回答
dabendan001 回答时间:2019-5-27 00:22:10
困扰我许久了,今天终于解决了。感谢论坛里诸位大神的回贴帮助。
解决办法:
ffconf.h文件中,我将 _MAX_SS 和 _MIN_SS均置为512了……问题所在。
改为:
#define        _MIN_SS                512
#define        _MAX_SS                4096
即可。

评分

参与人数 1蝴蝶豆 +2 收起 理由
STMCU + 2 总结问题

查看全部评分

所属标签

相似问题

关于意法半导体
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
招聘信息
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
关注我们
st-img 微信公众号
st-img 手机版