开发者

C/C++-Library for EEPROM wear-leveling under Linux?

开发者 https://www.devze.com 2022-12-26 20:47 出处:网络
does anybody know of a library for storing data securely in an 8k-EEPROM, which is attached over the I2C-interface? I am especially intere开发者_JS百科sted in wear-leveling as I have a write-intensive

does anybody know of a library for storing data securely in an 8k-EEPROM, which is attached over the I2C-interface? I am especially intere开发者_JS百科sted in wear-leveling as I have a write-intensive application where the EEPROM should/must be used as a NVRAM for often-chaning measurement data.

Thanks in advance, Martin


The only wear levelling code I've ever come across is in the MTD drivers in the kernel - either in the old JFFS2 filesystem or in the UBI level. These are designed for much larger FLASH devices, with correspondingly larger block sizes (typically 64KB). However, you might get some idea from the code (e.g. see drivers/mtd/ubi/wl.c in the kernel tree).

Otherwise, for your measurement data, you'll probably just have to maintain a ring buffer, as large as you can, and write each measurement into consecutive locations, along with a timestamp so that you can later come along and locate the latest one.

0

精彩评论

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

关注公众号