LittleFS - A high-integrity embedded file system

看起来不错的东西,实现了 POSIX标准接口,只需要填充硬件接口。

 

 

Any device that implements the BlockDevice interface can host a file system in Mbed OS. You can change the BlockDevice based storage drivers without changing your application or library code.

To start:

  1. Choose a driver that implements the BlockDevice API for your flash storage: DataFlashSD cardSFDP SPI Flash or implement your own.
  2. Initialize and mount the file system:

 

BlockDevice bd = /* get a block device */;

// first argument is the mount point, for example files will be available under /fs/, second a pointer to the block device
LittleFileSystem fs("fs", &bd);
  1. Use POSIX file system calls to read and write files (such as freadfopen and so on).

You can find an example program here. If you don't have any storage on your development board you can test this high-integrity embedded file system with the HeapBlockDevice, which stores the data in memory (but does not persist it).

posted @ 2018-12-13 11:10  flamewen  阅读(274)  评论(0编辑  收藏  举报