dlbeer / dhara

NAND flash translation layer for low-memory systems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Will it be feasible to use little file system(LFS) along with the use of dhara file translation layer(FTL) on Micron NAND flash MT29F4G08AB

pavzz-14 opened this issue · comments

So, we are trying to upgrade our existing Micron MT29 NAND flash from 2Gb to 4Gb on Atmel controller. The existing file system used is FAT32. But now we are in an need to change the file system to little file system(lfs). Will it be feasible to use this file system along with the file translation layer from dhara. I admire with @hchaudhary1 and @geky for thier insightful conversation.

I think in a perfect world you wouldn't need Dhara with LittleFS. But for better or worse, LittleFS is far from perfect.

Two cases come to mind where you may want to use LittleFS+Dhara:

  1. Better wear-leveling.

    LittleFS provides dynamic wear-leveling, whereas Dhara provides static wear-leveling. There's some interesting tradeoffs here, static wear-leveling is more expensive, but guarantees consistent wear across all blocks.

  2. Possible better performance for devices with large blocks.

    LittleFS currently has performance issues with large block sizes (littlefs-project/littlefs#214). Metadata-compaction is currently O(block_size^2), and until this is fixed you may get better performance if you use Dhara to divide the blocks into smaller "blocks".

Dhara is nice in that it treats the underlying block device as one continuous log. This makes it more flexible and predictable than LittleFS, which uses the erase blocks as data structure elements.

So, we are trying to upgrade our existing Micron MT29 NAND flash from 2Gb to 4Gb on Atmel controller. The existing file system used is FAT32. But now we are in an need to change the file system to little file system(lfs). Will it be feasible to use this file system along with the file translation layer from dhara. I admire with @hchaudhary1 and @geky for thier insightful conversation.

Hello Mr.pavzz, currently I also use Micron MT29 NAND flash 2Gb and I wirte I/O interface with it which works good (It can be erase, write and read normally) but I still stuck on dhara layer. The problem is when I find journal.root, it always returns j->root = DHARA_PAGE_NONE (0xFFFFFFFF). I don't know what exactly problem is, should I tune some parameters from dhara like gc_ratio, or DHARA_META_SIZE (I use all as default values). So many thanks for helping me!!!

@TatChung68 did you solved the problem?

@TatChung68 did you solved the problem?

Yes, I did. I'm using FATFS + dhara but my littlefs porting on NAND flash be working well too!!! If you wanna use little fs on raw nand flash you must only write correctly 4 functions to glue between nand flash and littlefs. No trick needed!

@TatChung68 could you share what was the actual problem and how did you solved it? I have been stuck with the same problem "journal.root, it always returns j->root = DHARA_PAGE_NONE (0xFFFFFFFF)" or I am making some mistakes. It would be very helpful to have some insightful direction on what can I do or what should I keep in mind. I am trying to follow this flash_management work by @aloebs29 and using QSPI for communicating with the flash. I have check and confirmed the low level functions are working correctly.

I think the problem is on your write and read, copy functions directly from NAND flash!!! You can refer this link. It run properly!!!

I think the problem is on your write and read, copy functions directly from NAND flash!!! You can refer this link. It run properly!!!

You are right, there were some problem with our write function, and after solving it everything is working fine. Thank you, for your response.