Skip to content

State of low-level flash storage interfaces #5398

Description

@x3ro

Currently there are several efforts to add a low-level flash interface to RIOT:

  1. Flash interface #2239 by @d00616 proposes an interface with memcpy-semantics, which appears to be designed with memory-mapped NOR flash in mind (?). It also comes with an implementation of the interface for native (using mmap) and the nrf51822.
  2. drivers/periph: added flashrom driver interface #5365 by @haukepetersen proposes an interface for page-aligned access which should work for both NOR and NAND flash. It comes with an implementation for nrf5x and stm32f1 CPUs.
  3. mtd flash: add a generic low level flash interface [RFC] #5624 by @vincent-d proposes another low-level interface
  4. Furthermore, an interface to access SD cards already exists in diskio.h, which is implemented for the lpc2387 (msba2). This one also provides page-aligned access.

I'd like to kick off a discussion on which kind of low-level interface we want for RIOT, since I think that, for simplicity, there ought to be only one.

I currently favor the interface proposed in #5365, since I feel that thinking of flash in terms of memory mapped I/O is dangerous: writing to the same address over and over is common in RAM, but destructive on flash. #5365 is relatively straight forward and can be extended with partial page writes/reads if necessary. We could even deprecate the diskio.h MCI interface after porting its functionality.

/cc @kYc0o @authmillenon @OlegHahm @kaspar030 @cgundogan

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: driversArea: Device driversType: questionThe issue poses a question regarding usage of RIOT

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions