FlashDB icon indicating copy to clipboard operation
FlashDB copied to clipboard

LittleFS implementation

Open GiulioDallaVecchia opened this issue 3 years ago • 5 comments

Hi FlashDB developer team,

I'm having a look about this DB. It seams very good and during this days I'm trying to use it with my STM32 board. I'm wondering if I can add the possibility to use this DB with LittleFS file system.

What do you think about?

Best regards,

Giulio Dalla Vecchia

GiulioDallaVecchia avatar Jan 20 '22 09:01 GiulioDallaVecchia

Yes. The FlashDB can run on filesystem mode. You can see the linux demo.

armink avatar Jan 20 '22 12:01 armink

Hi @armink,

Thanks for the reply! I've written the functions to work with littleFS file system (open, read, write, erase). I suggest you to create a porting file for each file system, otherwise fdb_file.c become very long and complex.

Best regards,

Giulio Dalla Vecchia

GiulioDallaVecchia avatar Jan 21 '22 07:01 GiulioDallaVecchia

The FDB filesystem mode support POSIX and LIBC API mode. Most filesystems support this type of API. So there is no need to modify the fdb_file.c file.

armink avatar Jan 21 '22 07:01 armink

In many embedded systems LittleFS is used as file system. It is very useful also because support static allocation. Unfortunately, it's not POSIX or LIBC API mode. Another file system that is used in embedded application is SPIFFS that is no POSIX or LIBC compliance.

Best regards, GDV

GiulioDallaVecchia avatar Jan 21 '22 07:01 GiulioDallaVecchia

Maybe you can try the RT-Thread RTOS. It has a Virtual File System and support POSIX or LIBC API mode.

The littlefs and FlashDB as software package on the RT-Thread. There is no need to modify the code when using these two packages on any hardware platform.

armink avatar Jan 21 '22 07:01 armink