LittleFS can't read last file created #36775
-
Hi there, I created an filesystem image on Ubuntu as described in Littlefs-fuse, with a simple TXT file just for testing and flashed it at the correct uC's memory address. For some reason, I cannot read the TXT file content. The function fs_open(&file, fname_txt, FS_O_READ) returns 0, which means it found the file, but the fs_read(&file, &buffer, sizeof(buffer)) returns 0 and the buffer array is empty. However, if I create a second file I can read the first file but not the second file and so on. The new file could be empty. I guess it could be some image's configuration, but I can't figure it out. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Have you provided the lfs, when creating the image, with following parameters: according to your board DTS/Kconfig parameters? |
Beta Was this translation helpful? Give feedback.
Have you provided the lfs, when creating the image, with following parameters:
--block-size
equal to flash device erase page size--read_size
--prog_size
--block_cycles
--cache_size
--lookahead_size
according to your board DTS/Kconfig parameters?