您能为嵌入式系统推荐哪种免费的最小闪存文件系统?
我的板上有 DSP tms320vc5509a 和 NOR 闪存 AT26DF321,我将在闪存上存储命名数据。我不需要目录层次结构、磨损均衡(我希望系统写入闪存的次数很少),但强烈需要 CRC。 谢谢
I've got DSP tms320vc5509a and NOR flash AT26DF321 on the board and I'm going to store named data on the flash. I don't need directory hierarchy, wear leveling (I hope system will write to flash very few times), but CRC is strongly needed.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 NOR 闪存上,尤其是还包含启动代码和应用程序的闪存上,我通常会避免正式文件系统的开销。相反,我存储每个“有趣”的对象,从擦除块边界开始,并从至少保存对象大小和校验和的标头结构开始。将名称或资源 ID 添加到标头是一种自然的扩展。
引导加载程序在使用该块之前通过验证校验和来查找有效的应用程序。同样,其他资源也可以在使用前确认其有效。
它还使固件更新实用程序可以轻松地在擦除对象并将其编程到闪存之前验证该对象。
处理小型资源池的最佳方法可能是将其包装在容器中进行闪存。如果运行时资源支持它,我会倾向于使用 ZIP 来包装文件,将 ZIP 存档的映像包装在大小和校验和标头中,并将其存储在擦除块边界处。如果您负担不起解压缩运行时的费用,仍然可以使用带有未压缩文件的 ZIP,或者使用更简单的格式,例如 tar。
当然,对于 NAND 闪存来说,情况就大不相同了。在那里,我强烈建议选择一个针对 NAND 闪存特性而设计的成熟(商业或开源)文件系统。
On a NOR flash, especially one that also contains my boot code and application, I generally avoid the overhead of a formal file system. Instead, I store each "interesting" object starting at an erase block boundary, and beginning with a header structure that at minimum holds the object size and a checksum. Adding a name or resource ID to the header is a natural extension.
The boot loader looks for a valid application by verifying the checksum before using the block. Similarly, other resources can be confirmed to be valid before use.
It also makes it easy for a firmware update utility to validate the object before erasing and programming it to the FLASH.
A pool of small resources might be best handled by wrapping it in a container for flashing. If the runtime resources support it, I would be tempted to use ZIP to wrap the files, wrapping the image of the ZIP archive in a size and checksum header and storing it at an erase block boundary. If you can't afford the decompression runtime, it is still possible to use ZIP with uncompressed files, or to use a simpler format such as tar.
Naturally, the situation is very different for a NAND flash. There, I would strongly recommend picking an established (commercial or open source) filesystem designed for the quirks of NAND flash.
您可以查看 ELM-Petit FAT 文件系统模块,了解一个不错的小型文件系统文件系统的实现。不确定它是否有 CRC,但您可以将其添加到低级硬件驱动程序中。
You could look at the ELM-Petit FAT File System Module for an good small file system implementation. Not sure that it has CRC but you can add that to your low-level hardware drivers.