Open
Description
Hi!
We are currently trying to figure out a way to change our FS-less data storage to LittleFS.
The idea is:
- move everything to the end of the flash (keeping track of the bad sectors with our own solution)
- create LittleFS at the beginning of the flash.
- copy the existing data to LFS files
- expand the LittleFS partition to the whole chip
It's sort of easy to do, except the last step. The problem is that the number of blocks are written in the superblock at format, and I haven't found a way to expand the partition without reformatting. I have checked the code, and I couldn't find if the block number in the superblock is used at all.
So I guess we could:
- not care about it. Just format as if we would be using the whole chip, and the block allocator will (hopefully) allocate the beginning of the flash anyway (Haven't checked if this works though...)
- The same, but the flash driver gives an error if the FS tries to access the end of the flash.
- Format with only half flash size, and hack the superblock afterwards. I guess you can just change the block number and fix up the CRC. Might not be this easy.
All of these are pretty hacky, so I'm curious if anyone has other ideas on how to do it.
Thank you in advance.