PaulStoffregen / LittleFS

75 stars 20 forks source link

Updated for NAND/FeRAM.Fram and tweaks #7

Closed mjs513 closed 3 years ago

mjs513 commented 3 years ago

Good Morning Paul (@Defragster, @KurtE) Kurt recommended that we go ahead an issue a PR for the updates that we made so far to give you a chance to review the changes when you get a chance and let us know if you want anything changed. Right now we added support for the NAND (N01, N02 and M02), the Cypress FRAMs and the ROHM MR45V100A 1 Mbit FeRAM Memory chip. NOTE: FRAM and FeRAM is only supported via SPI). Besides those changes, Tim added functions for formatting only unused blocks which seem to be working rather well.

The FRAM/FeRAM is supported in LittleFS.cpp and NAND has its own driver files.

I did notice that you updated lfs to pull in that PR we mentioned in the thread https://github.com/littlefs-project/littlefs/pull/508.

Tim has pretty much killed it on testing the NAND and FRAM changes with his LFSIntegrity sketch.

Ok now for BBLUT and bad block management. I did add some code for the N01 to perform BBM, however, the actual writing to the BBLUT has been commented out. Reason is I need to come up with a way to test to make sure its doing what I want so that is an open issue. N02 isn't supported primarily because there is nothing in the RM that talks to remapping the blocks or a BBM command - wondering if this is an omission for the N02, The M02 is a bit unique since its basically 2 N01 dies on 1 chip and can have two BBLUT's - one for each die and I haven't figured that one out yet.

A couple more notes on BBLUT. I reduced the FS size to reserve 24 blocks for remapping (not sure this is 100% correct but think I read that somewhere with LittleFS) and use that area for remapped blocks. I did have to modify the formatLowLevel function to take this into account so now I have a separate formatLowLevel function in NAND that calls LittleFS formatLowLevel and then adds calls to erase the reserved blocks as well. Not sure what to do wit quickFormat though - may have to mod that as well. Any thoughts when you get a chance - know you are busier than heck between running the business and getting the bootloader working :)

mjs513 commented 3 years ago

Good Evening Paul (@Defragster, @KurtE) Finally got around to adding BBM support for the W25M02 Flash chip. Have no idea what to do with the N02 since Winbond said BBM is not supported on the N02 and its up to the controller.

I also updated the BBM_ECC sketch.

PaulStoffregen commented 3 years ago

Merging this in prep for 1.54-beta6....