EEPROM tiny fs

Hello,

I am nearly done creating a filesystem library for the EEPROM. Right now I’m only working with 1kb of EEPROM because I’m using a mini pro.

Some simple stats:

4bytes “superbyte”
No inodes.
29 x 35 byte chunks.

Chunk = 1byte meta, 1byte key (filename), 1byte crc, 32bytes data.
29 chunks = max 29 files <=32bytes
or 1 928byte file

Even wear levelling with CRC data corruption checking and bad chunk ignoring/redundancy.
Templated dependancy inject so the EEPROM data layer can be swapped out for anything with addressable byte level read/writes

I need to implement non-atomic writes and I’ll put the library up somewhere.

Does anyone have any requests / questions?
How about suggestions / tips? This will be the first library I make public.

Thanks!

Can you make it work with an external EEPROM such as the 24LC256? The Arduino DUE suffers from having no on-board EEPROM so it always needs another chip.

I added the non-atomic writes so I’ll move it over from a private repo sometime this weekend to github.

Data storage is handled through template dependency injection

For example this is how the library uses the on chip eeprom

class _eepromAccess 
{
	uint8_t read(const uint8_t *__P)
	{
		return eeprom_read_byte(__P);
	}
	void write(uint8_t *__p, uint8_t __value)
	{
		eeprom_update_byte(__p, __value);
	}
};

extern EEPROMFSClass<_eepromAccess> EEPROMFS;

You can put any other means of storing and retrieving bytes in read and write such as the code to access the 24LC256 or in my testing cases storing in ram memory and counting read/writes. You could even do data over the wire and send the bytes through serial to store on a pc… it’s up to you.