Using dhara for nor and nand flash - some questions
Laczen opened this issue · 5 comments
Hi @dlbeer, thank you for providing dhara.
I am looking at using dhara for both nor and nand flashes as a "virtual block manager" with wear levelling. Dhara already provides excellent support for nand flashes but for nor flashes I am running into some issues:
- Nor flashes are a lot smaller then nand flashes so it is wanted to keep the dhara_meta_size small, there are two possibilities to do that: reduce the radix depth and reduce the meta entry.
I have been succesfull at reducing the radix depth (is it correct that this can be seen as a measure of the amount of logical pages ?).
Reducing the size of the meta entry (is it correct that this can be seen as a measure of the amount of physical pages ?) seems to be more difficult, what would be the best way to reduce this to e.g. a uint16_t ?
- Nor flashes have the ability to continue writing to a page, would it make sense to introduce a
dhara_nand_rewrite()
routine that tries to rewrite a page and if it fails to continue the present behaviour. For nand flashes this routine could just return an error.
I have been able to also reduce the size of the meta entry to a uint16_t. Would you accept a PR that enables smaller radix depth and meta size entry ?
Something I am missing is a way to validate the checkpoint metadata page, a addition of a crc32 at the end of that page could resolve this, what is your opinion ?
On Tue, Nov 23, 2021 at 08:17:58AM -0800, Jehudi Maes wrote: I have been able to also reduce the size of the meta entry to a uint16_t. Would you accept a PR that enables smaller radix depth and meta size entry ?
I would prefer not to have to support something like this in the master branch, as it adds complexity for testing if it's a compile-time option. However, if you wanted to post your local changes here I'd be happy to check it over for issues and review it if that's helpful to you.
Thank you for your quick reply. I will keep my changes local for the moment. I was thinking about adding support for dhara into zephyr, but for that dhara would need to be a little bit more configurable and also support nor flashes.
Regarding the rewrite, most nor flashes allow you to rewrite a certain flash location as long as you only change 1's to 0.