This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Settings via littlefs on internal flash

Hi,

I'm currently trying to use littlefs as the storage backend for the settings subsys and the internal flash for the actual memory. LittleFS is working in general but if failed so far to use it for storing settings.

Upon settings initialization it complains about not finding the mount point and according to the logs it is right about this. When I try to crate a fstab entry in order to enable automount like this:

/ {
    fstab {
        compatible = "zephyr,fstab";
        lfs1: lfs1 {
            compatible = "zephyr,fstab,littlefs";
            mount-point = "/lfs1";
            partition = <&storage_partition>;
            automount;
            read-size = <16>;
            prog-size = <16>;
            cache-size = <64>;
            lookahead-size = <32>;
            block-cycles = <512>;
            no-format;
        };
    };
};

The logging looks like this:

[00:00:00.248,260] fs.fs_register: fs register 1: 0

[00:00:00.255,889] littlefs: littlefs partition at /lfs1

[00:00:00.263,977] littlefs: LittleFS version 2.2, disk version 2.0

[00:00:00.273,010] littlefs.littlefs_mount: FS area 0 at 0x0 for 49152 bytes

[00:00:00.282,836] littlefs: FS at NRF_FLASH_DRV_NAME:0x0 is 12 0x1000-byte blocks with 512 cycle

[00:00:00.294,464] littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32

[00:00:00.303,405] littlefs: /lfs1 mounted

[00:00:00.310,272] fs: fs mount error (-5)

[00:00:00.317,413] littlefs: Automount /lfs1 failed: -5

Where flash offset and and number of blocks are clearly wrong. Do I do something obviously wrong here?

Regards

Caspar

Related