Open baranovus opened 3 years ago
Ah, I'm not sure the original source, but "memory allocation" should really be "storage". LittleFS requires ~6 blocks of storage to work with. There's not really a lower bound on memory, though a large cache_size = less bus transactions = faster.
But 6 blocks of storage is the bare minimum. If you have multiple or large files you may need more storage. How much data are you trying to write?
Hello and thanks! I need to keep about 10 files. Most of them are about 100 bytes and a couple of them may be about 100 K. I think I am confused with the word "block". When we say "block" do we mean the size of erasable block of the flash memory (4096 Bytes in my case)? If yes, do I need ~24 K of storage and that will be the size of my cache? Now I have:
.read_size = READ_SIZE, .prog_size = PROG_SIZE, .block_size = ERASABLE_BLOCK_SIZE,
Where am I wrong?
@baranovus any luck with this?
Hello Jim. After some modifications which seem to be unconnected with the problem the error disappeared, but of course I am not satisfied because I don't understand what had been done wrong.
Okay thanks very much for your reply.
Hello. Sorry for asking the question, which might been already answered. I have an error message lfs_error .. No more free space. I saw in discussions the following: " *I found the solution in your README mentioning LFS requires at least 6bd.erase_size() of memory allocation.." Could somebody explain what is it? Does it mean that I have to set .block_size* equal to 6 flash erasable block size values? For example, if my flash allows erasing block of 4096 bytes, should I set block_size = 6 X 4096? Or does it mean that I have to have enough heap for 64096 = 24576 bytes?