Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Using Dhara in Zephyr #30

Open
pnchatterji opened this issue May 16, 2022 · 10 comments
Open

Using Dhara in Zephyr #30

pnchatterji opened this issue May 16, 2022 · 10 comments

Comments

@pnchatterji
Copy link

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
Copy link

int32cn commented May 16, 2022 via email

@dlbeer
Copy link
Owner

dlbeer commented May 18, 2022

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
Copy link
Author

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

@OleksandrDroid
Copy link

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
Copy link
Author

pnchatterji commented Nov 21, 2022 via email

@OleksandrDroid
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link

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
Copy link
Author

pnchatterji commented Nov 30, 2022 via email

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

No branches or pull requests

4 participants