Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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 #13

Closed
pavzz-14 opened this issue Oct 13, 2020 · 9 comments

Comments

@pavzz-14
Copy link

pavzz-14 commented Oct 13, 2020

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.

@pavzz-14 pavzz-14 changed the title Can I use little file system(LFS) alone or should I also consider the use of dhara file translation layer(FTL) Will it be feasible to use little file system(LFS) along with the use of dhara file translation layer(FTL) Oct 13, 2020
@pavzz-14 pavzz-14 changed the title Will it be feasible to use little file system(LFS) along with the use of dhara file translation layer(FTL) Will it be feasible to use little file system(LFS) along with the use of dhara file translation layer(FTL) on Micron NAND flash Oct 13, 2020
@pavzz-14 pavzz-14 changed the title Will it be feasible to use little file system(LFS) along with the use of dhara file translation layer(FTL) on Micron NAND flash 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 Oct 13, 2020
@dlbeer
Copy link
Owner

dlbeer commented Oct 14, 2020 via email

@geky
Copy link

geky commented Oct 15, 2020

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 (Open and Close File Performance 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.

@TatChung68
Copy link

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!!!

@Atanukumardey
Copy link

@TatChung68 did you solved the problem?

@TatChung68
Copy link

@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!

@Atanukumardey
Copy link

Atanukumardey commented Mar 16, 2024

@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.

@TatChung68
Copy link

TatChung68 commented Mar 16, 2024 via email

@TatChung68
Copy link

TatChung68 commented Mar 16, 2024

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

@Atanukumardey
Copy link

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants