dlbeer / dhara

NAND flash translation layer for low-memory systems
Other
405 stars 119 forks source link

Using Dhara in Zephyr #30

Open pnchatterji opened 2 years ago

pnchatterji commented 2 years ago

Hello,

I am thinking of using Dhara in the Zephyr RTOS for an external NAND flash (Winbond W25M02GW). Are you aware if anyone has already done this? In case I have to do this myself, I presume the best way would be to use Dhara as the translation layer of the FAT_fs file system which is already a part of Zephyr. Is this correct? Or would it be better to write a new file system wrapper that directly invokes Dhara? Btw., I have tried using Little_FS, which also supports NAND and which is already a part of Zephyr, but I find it too slow for my application, so I am looking at alternatives. That is why I am looking at Dhara. Btw, I have also created a file system wrapper for Zephyr for FLOGFS, another NAND file system, and that is fast enough for my needs, but that has another set of problems (weak handling of extreme cases) thanks regards

int32cn commented 2 years ago

你好, 你的邮件已收到,谢谢!! 此为自动回复。

dlbeer commented 2 years ago

I haven't used Zephyr, but I have seen Dhara used as an FTL to provide a block device to FATFS on FreeRTOS. I don't see any reason why what you're describing shouldn't work.

The only things to watch out for are the usual thread-safety and re-entrancy issues, which Dhara does not address by itself. FATFS has an option to provide locking, which you'll likely want to use. Any other Dhara operations that don't go via FATFS should be protected by either restricting them to a portion of the code where it's known that nothing else is running (e.g. during early init), or by reaching in and acquiring FATFS's lock.

pnchatterji commented 2 years ago

thanks for the tips, dlbeer! I'll let you know how it goes...

OleksandrDroid commented 1 year ago

We have integrated dhara into a project based on Zephyr. Nothing special on the part of the Zephyr is used. Have a nice coding! )

pnchatterji commented 1 year ago

@Oleksandr Tymoshenko Thanks for the information! What is the feedback regarding performance? Pashupati

On Mon, Nov 21, 2022 at 11:39 AM Oleksandr Tymoshenko < @.***> wrote:

We have integrated dhara into a project based on Zephyr. Nothing special on the part of the Zephyr is used. Have a nice coding! )

— Reply to this email directly, view it on GitHub https://github.com/dlbeer/dhara/issues/30#issuecomment-1321848272, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXMA6E5VVAJ7YDSDN2AI5KDWJNGNNANCNFSM5WCAW6YA . You are receiving this because you authored the thread.Message ID: @.***>

-- Member of Maxworth Home Bangalore Plot Owners Association https://www.facebook.com/maworthnagarbannergattabangalore

OleksandrDroid commented 1 year ago

Due to some shortcomings in the hardware of our device, I am not ready to give feedback on performance. In the schematic for the next version, we have corrected these shortcomings, and it will be very interesting to measure the performance. I will let you and other members know.

pnchatterji commented 1 year ago

Thanks Oleksandr, look forward to your feedback later! Based on your feedback, we may decide whether we want to explore this too for our platform. We were planning to do it, but this work went on the back burner.

pnchatterji commented 1 year ago

Hi Oleksandr, just curious to know, what approach did you use to integrate Dhara into Zephyr? Did you use it as a translation layer under FatFS or LitteFS, or did you write your own custom file system wrapper around Dhara? I was hesitating between these two approaches and it would be interesting to know how you did it. Would it be possible to share your code? Thanks in advance!

OleksandrDroid commented 1 year ago

Hello @pnchatterji

Sorry for the delay in replying. I'm not allowed to share my source code with you, but I can give you a link to one guy's project that integrated dhara. I used this as an example.

https://github.com/aloebs29/flash_management

pnchatterji commented 1 year ago

@Oleksandr Thanks a lot for the link! I'll check it out

On Wed, Nov 30, 2022 at 11:18 AM Oleksandr Tymoshenko < @.***> wrote:

Hello @pnchatterji https://github.com/pnchatterji

Sorry for the delay in replying. I'm not allowed to share my source code with you, but I can give you a link to one guy's project that integrated dhara. I used this as an example.

https://github.com/aloebs29/flash_management

— Reply to this email directly, view it on GitHub https://github.com/dlbeer/dhara/issues/30#issuecomment-1331927060, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXMA6E3VXWJJ5VFL7WR3FFDWK4SYLANCNFSM5WCAW6YA . You are receiving this because you were mentioned.Message ID: @.***>

-- Member of Maxworth Home Bangalore Plot Owners Association https://www.facebook.com/maworthnagarbannergattabangalore