Littlefs: multiple partitions

Created on 3 Jul 2020  路  2Comments  路  Source: littlefs-project/littlefs

Hello to everyone,
I'd like to create two partition using littlefs, but I haven't found the way to do this.

There is a way to create more partition using littlefs?

Could someone help me?

Thanks,
Giovanni

question

All 2 comments

You can create more than one drive in littleFs - you create and use two separate file systems, each with a separate file definition block (type lfs_t). These may be on different memories, or the same memory.
If you use the same block of memory for both file systems, decide how much memory is to be allocated to each file system. The low-level drivers which are called by littleFs receive a block number and offset _within that file system's memory_, and your drivers need to convert that into a start address within the right part of the memory.

similar to what @e107steved said, I added a "block offset" item to the lfs_configuration so I can generically calculate the correct block in the block device functions .. This allowed me to initialize multiple lfs partitions that all use the same block device functions. my primary partition starts at block_offset=0, while my secondary partition starts at block_offset=1024

Was this page helpful?
0 / 5 - 0 ratings

Related issues

roceh picture roceh  路  6Comments

blomnik picture blomnik  路  3Comments

davidefer picture davidefer  路  7Comments

roceh picture roceh  路  8Comments

umanayana picture umanayana  路  5Comments