Hardware: nRF52832 on the nRF52-DK
SDK: nRF Connect v2.0.0
IDE: Visual Studio Code 1.73.1 with nRF Connect for VS Code (v2022.11.140) extension
I'm trying to get familiar with writing and reading information from the littlefs on my nRF52832. The end goal is to have a log file that I will write prior to going into SYSTEM_OFF, and this will then get read back when the device exists SYSTEM_OFF, updated with new information, and then re-written to the littlefs.
I've been using the littlefs example (.../samples/subsys/fs/littlefs/) as a basis. All I've changed is to add some MCUBoot functionality and to add fixed partitions for my littlefs_storage space in Flash, as in my end code, I'll be using the settings_storage for settings and NVS, and want to control the amount of memory I allocate for littlefs. If I set up the littlefs parition as follows, my example (attached below) works as expected.
However in my end code, I won't have this much space available, and so I have been experimenting with reducing the fixed partition space for littlefs, with mixed results. If I set my fixed partition as follows:
and then if I have TEST_FILE_SIZE = 64, everything works. But if I set TEST_FILE_SIZE = 65 or higher, then I get the following errors:
This appears to be indicating that I am running out of space, but given I've allocated 8kB of flash, and I'm only trying to store 65 bytes in total (/boot count and /pattern.bin), I can't understand why this is occuring.
Can anyone with some experience in littlefs give me some pointers as to how I can resolve this? Or at least help me understand why I'm getting the "No more free space" error with 8kB of flash and only 65 bytes of info being written to it?
Here is my example code:
Thanks,
Mike