[riot-devel] Save data in ROM

Frank Holtz frank-riot2015 at holtznet.de
Thu Aug 27 11:01:38 CEST 2015


first we need an interface to read and write data to flash. An
specification can be found in RIOT/drivers/include/flashrom.h or another
specification in my pull request https://github.com/RIOT-OS/RIOT/pull/2239

At the moment i'm on the way to port http://bitlash.net/ to RIOT. For
full functionality i need an interface to flash or access to an file system.

My idea was to build an configuration store which is compatible with
various flash types. In MCU supported by RIOT there are build in Flash
with Error Correction or without error correction. There are many
different page sizes. There are Platforms with the possibility to
overwrite single bits without erasing pages (e.g. NRF51) and i think
there are platforms with error correction where i can only write an page
once. This is also an memory alignment problem. In my PR i have written
code to allow unaligned access but i don't know if this is portable to
any platform.

Another problem is how often an page can erased. On many platforms
10.000 erase cycles are possible. This is not enough for counters in
flash. My idea was to create an object store starting at top of flash
memory. Every write allocates a new space until there are no free pages
available. When no page is available the flash memory needs cleaning.

If possible counter objects are placed in a whole page and changed at
bitlevel. So its possible to count 8,000,000 times per 1k page with
10.000 erase cycles.

At the moment i have no time to work on this topic.



More information about the devel mailing list