views:

94

answers:

1

Hi,

does anybody know of a library for storing data securely in an 8k-EEPROM, which is attached over the I2C-interface? I am especially interested 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

+1  A: 

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.

Richard M-S