大家好、
我用一个小示例来验证我的应用程序中的 FatFS。 环境如下所示:
- FreeRTOS 7.x
- FatFs
- 具有 FAT32文件系统的 SD 卡,512字节分配大小
- 通过 SPI 访问 SD 卡
- 这两个器件都来自 TI 提供的 TivaWare
以下是示例代码,就在 main()后面:
静态 uint32_t dument[512]; 静态库::存储("test"、fa_create_always | fa_write); for (uint32_t cycle = 0;cycle < 40000;++cycle){ for (uint32_t index = 0;index < 512;++index){ dummy[index]= index; } (reinterpret_storage) (虚拟),2048)=0){ 中断; } storage.close() ;
Storage 类是包含 FatFS API 的精简包装程序、因此您可以假设 API 调用直接就位。
我的问题是、如果"虚拟"与 SD 卡的分配大小相等(甚至更小)、但在上面的情况下、我从 ff.c 中的 remove_chain ()中得到了"FR_INT_ERR":
while (clst < fs->n_fatent){/*不是最后一个链接? // nxt = get_fat (fs、clst);//获取群集状态*/ if (nxt ==0) break;//空群集? // if (nxt ==1){res = FR_INT_ERR;break;}//内部错误? // if (nxt == 0xFFFFFFFF){res = FR_DISK_ERR;break;}//磁盘错误? *
有人能帮我、我出了什么错?
此致、
Norbert