Skip to content

Add persistent storage using part of MCUs flash #886

@thwr

Description

@thwr

nanoFramework area:
General feature for most targets

Is your feature request related to a problem? Please describe.

Yes and no: Currently there is no way to save configuration parameters across restarts.

Describe the solution you'd like

In embedded projects, you often need to store a very small but configurable set of configuration parameters. The configuration can be done via a UI (Display + Keys), via a network interface (REST API, ...) or even by using desired properties of Azure IoT Hub DeviceTwin, for example.

Regardless of how the configuration is done, there should be a way to have it persist between power loss / reboot events.

To achieve this goal, nanoFramework could provide frontend applications with memory backed up by a small portion of the respective MCU's flash memory (in the range of a few kilobytes). This memory does not need to be managed in any way, frontend applications could use (binary) serialization/deserialization to store and retrieve data, for example.

Describe alternatives you've considered

External memory such as I2C/SPI EEPROMs, SD cards, etc. could suffice for this task, but require additional hardware, drivers, and application logic. On the other hand, nanoFramework already uses a system like the one described above to store network configuration parameters and certificates, so it should not be too complicated.

Additional context

This feature should be beneficial for almost all projects that go beyond "hello world". So it would be nice to see this feature becoming reality.

Submit a PR with the implementation

n/a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions