本帖最后由 st316 于 2012-8-1 15:47 编辑
有没有人在STM32F2x上面用过rt-thread里的文件系统?
下载下来的rt-thread压缩包里有相关的例程,但读写SD卡会出错。- /* init the device filesystem */
- dfs_init();//成功
- /* init the elm chan FatFs filesystam*/
- elm_init();//成功
- /* mount sd card fat partition 1 as root directory */
- if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)//成功
- {
- rt_kprintf("File System initialized!\n");
- /* 只写 & 创建 打开 */
- fd = open(TEST_FN, O_WRONLY | O_CREAT | O_TRUNC, 0);//出错,返回-1
- }
- else
- rt_kprintf("File System initialzation failed!\n");
试了一下STM32F10x的例程,操作SD卡是没有问题的。
哪位在STM32F2x上用过RT-Thread里文件系统的帮下忙啦!
|