dhara icon indicating copy to clipboard operation
dhara copied to clipboard

Using Dhara in Zephyr

Open pnchatterji opened this issue 3 years ago • 12 comments

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

pnchatterji avatar May 16 '22 16:05 pnchatterji

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

int32cn avatar May 16 '22 16:05 int32cn

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.

dlbeer avatar May 18 '22 02:05 dlbeer

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

pnchatterji avatar May 18 '22 06:05 pnchatterji

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

OleksandrDroid avatar Nov 21 '22 10:11 OleksandrDroid

@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

pnchatterji avatar Nov 21 '22 14:11 pnchatterji

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.

OleksandrDroid avatar Nov 21 '22 15:11 OleksandrDroid

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 avatar Nov 22 '22 15:11 pnchatterji

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!

pnchatterji avatar Nov 26 '22 12:11 pnchatterji

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

OleksandrDroid avatar Nov 30 '22 10:11 OleksandrDroid

@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

pnchatterji avatar Nov 30 '22 11:11 pnchatterji