zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.7k stars 6.54k forks source link

Add NAND Flash driver and NFTL driver to enable LittlefS to run on NAND Flash #50795

Open rogeryou opened 2 years ago

rogeryou commented 2 years ago

This issue is an extension of #46399. We propose a proposal to expand LittleFS.

At present, LittleFS only supports running on NOR Flash. However, some users want LittleFS to run on NAND Flash, so we are currently developing NFTL and NAND Flash drivers to achieve this goal. NFTL mainly realizes functions such as wear leveling and bad block management.

The architecture of the entire driver is shown in the figure below. SPI NAND Flash and ONFI NAND Flash will be supported. We have submitted a PR on SPI NAND Flash. If this proposal is accepted, we will submit two PRs for ONFI NAND driver and NFTL driver.

LittleFS driver

deyro commented 1 year ago

Hi, any plans on when this will be available to users? Thanks

mintisan commented 1 year ago

+1

clockis commented 1 year ago

+1

clockis commented 1 year ago

Greetings, are there any updates on this? I think there is much demand for this as many applications utilize NAND flash.

fwittenfeld commented 1 year ago

Any chance to get early access to the project?

rogeryou commented 1 year ago

We will submit a PR about NFTL 2 weeks later.@fwittenfeld @clockis

rogeryou commented 1 year ago

Hi , @fwittenfeld @clockis @deyro @mintisan We have previously developed NFTL and littleFS based on mbed for using NAND Flash. You can refer to this link for more information.

kyrreaa commented 1 year ago

+1 here too. Currently on NRF5340 and have our own NAND version of the NRF QSPI NOR driver but performance is very poor. (Hardcoded instructions in the NRF for QSPI requires use of custom commands and slow manual sequence.)

Yaxit commented 8 months ago

+1 a solid interface could help to bring so many projects up to speed

kyrreaa commented 8 months ago

I actually ended up rewriting my driver to use SPIM instead on the NRF5340 as this allowed fully async operations in large read/writes instead of having to bypass the NOR instruction flow with custom transfers to do NAND. Took a huge load of the cpu. (QSPI hardware on NRF5340 has hardcoded instructions for NAND that cannot be bypassed.)

Yaxit commented 8 months ago

@kyrreaa I'd be interested in having a look at what you did, if possible :)