开发者

Flash memory data format [duplicate]

开发者 https://www.devze.com 2023-01-07 08:39 出处:网络
This question already has answers here: What free tiniest flash file system could you advice for embedded system?
This question already has answers here: What free tiniest flash file system could you advice for embedded system? (2 answers) Closed 2 years ago.

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 c开发者_JAVA技巧omplete extra copies.

Any suggestions?


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. :-)


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...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号