闪存数据格式
我正在寻找一个存储库,用于在嵌入式系统的闪存中存储数据。由于需要一种具有正确的功能和简单性组合的格式,我即将编写一个自定义格式。
理想情况下,它是一种格式和 C/C++ 库,比存储原始结构更好,但又比完整的文件系统复杂。我需要存储多个数据结构,其中一些是可选的,并且可能会不时更改格式。
最好有简单的磨损均衡/日志方案和数据冗余/可靠性功能。简单的日志记录是因为我正在使用的大多数低级闪存芯片在从一端写入另一端并从顶部重新开始时是最快乐的。数据冗余/可靠性可以是奇偶校验位的使用和检查或完整的额外副本。
有什么建议吗?
I'm looking for a storage library for storing data in flash memory in an embedded system. I'm on the verge of writing a custom one for want of a format with the right mix of features and simplicity.
Ideally it would be a format and C/C++ library with something better than storing raw structures, but less complex than a full blown file system. I need to store multiple data structures some of which are optional and may change format from time to time.
Nice to haves would be simple wear leveling / journaling schemes and data redundancy/reliability features. The simple journaling is because most low level flash chips I'm working with are happiest when you write from one end to another and start over at the top. Data redundancy/reliability could be use and checking of parity bits or complete extra copies.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
JFFS2 是一个明显的候选者。我已经将它与 MIPS 和 SuperH 一起使用,但仅限于 NAND。它在磨损均衡和性能方面取得了很好的效果。不,它是一个成熟的文件系统,似乎不是您所描述的那样,但老实说,我认为您不会找到满足您需求的单一解决方案。但这可能是最简单的解决方案:JFFS2 + {SQLite|Protobuf|Berkeley DB}
我确实希望我错了,并且您能找到一个。 :-)
JFFS2 is an obvious candidate. I have used it extensibly with MIPS and SuperH guys, but only with NAND. It gives great results in wear leveling and performance. Not, it is a full-blown file-system which doesn't seem to be what you describe, but honestly, I don't think you'll find a single solution for what you want. But it might be the simeplest solution: JFFS2 + {SQLite|Protobuf|Berkeley DB}
I do hope that I'm wrong and you find one. :-)
与 Robert 和 Mtr 一样,我可以推荐 FatFs 通用文件系统模块。
我在带有 3 个逻辑设备(USB、SD 卡和外部闪存)的 Cortex-M3 上使用它。
尤其是 f_mkfs 非常方便地将文件系统获取到外部闪存。
我必须自己编写的“唯一”内容是低级磁盘 I/O 函数。
如果您不需要 FatFs 模块提供的所有功能,则使用 config.h 减小模块大小非常容易(不记得名称了:D)。
编辑:我选择FAT,因为它可以被Win & 使用。 Linux...
Like Robert and Mtr I can recommend the FatFs Generic File System Module.
I am using it on an Cortex-M3 with 3 logical devices (USB, SD-Card and external Flash).
Especially the f_mkfs was very handy to get the FileSystem to the external Flash.
The "only" thing I had to code my self were the low level disk I/O functions.
If you do not need all functionality provided by the FatFs module, reducing the module size is pretty easy using the config.h (can't remember the name :D).
Edit: I chose FAT as it can be used by Win & Linux...