You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I have a long lived file and we are writing data for a long duration (multiple Mb). Though it seems the write operation becomes longer and longer as we add more data to the file and eventually it starves the MCU causing other operations to timeout. It starts at less than 1ms to write the file content to more than 100ms after adding a lot of data.
Note that we are writing a lot of small chunk of data (5 bytes) but we are using a cache for each file and it seems the number of operations (read/write accesses) increases with the length of the file.
Is this a known fact that the write operations are proportional to the file size? We are using NAND flash but adapted the driver to offer a similar interface to NOR flash so it shouldn't be an issue. Is there anyway to increase the speed? Like periodically sync the file to the filesystem?
Are you doing random writes (rather than simply appending)? If so, that's your problem. The nature of the file structures mean that data after the insertion point has to be rewritten. Search the "issues"; there are some far better explanations of this than I can give.
Hi, i'm doing sequential write. After some digging, I've found the info I was searching for in issue #783 so I'll close this issue. Buffering the write also helped quite a bit.
Currently I have a long lived file and we are writing data for a long duration (multiple Mb). Though it seems the write operation becomes longer and longer as we add more data to the file and eventually it starves the MCU causing other operations to timeout. It starts at less than 1ms to write the file content to more than 100ms after adding a lot of data.
Note that we are writing a lot of small chunk of data (5 bytes) but we are using a cache for each file and it seems the number of operations (read/write accesses) increases with the length of the file.
Is this a known fact that the write operations are proportional to the file size? We are using NAND flash but adapted the driver to offer a similar interface to NOR flash so it shouldn't be an issue. Is there anyway to increase the speed? Like periodically sync the file to the filesystem?
Here's our current setup:
LittleFS version: 2.5.1 (also tested with 2.7.0, same issue)
NAND chip: w25n01gw
READ_SIZE: 1
WRITE_SIZE: 512
BLOCK_SIZE: { 64 * 2048 }
BLOCK_COUNT: 1000
BLOCK_CYCLES: 256
METADATA_MAX: 2048
CACHE_SIZE: 512
LOOKAHEAD_SIZE: 512
The text was updated successfully, but these errors were encountered: