littlefs-project / littlefs

A little fail-safe filesystem designed for microcontrollers
BSD 3-Clause "New" or "Revised" License
4.92k stars 774 forks source link

LFS_ERR_INVAL for every Mount #892

Open Aravind0812 opened 8 months ago

Aravind0812 commented 8 months ago

Currently, I am working on the W25q512 module in stm32. I am writing some data in the file, and then I close the file. After that, the same file mounting failed it returned LFS_ERR_INVAL in ( founding superblock). Close the file and unmount all are successful. My Configuration is

read_size = 16 prog_size = 16 block_size = 4096 block_count = 16384 cache_size = 256 lookahead_size = 16 block_cycles = 500

I got an error here,
// found superblock?
if (lfs_pair_isnull(lfs->root)) {
    err = LFS_ERR_INVAL;
    goto cleanup;
GiulioDallaVecchia commented 8 months ago

Hi @Aravind0812,

Be careful, with W25Q512 you can only do 256 byte aligned writing (page size). So should be better to set prog_size = 256