Hej
Im trying to mount two littlefs filesystems. One on externl flash and one on the nvs.
Up until now I have been using littlefs on my external flash without any problems.
I have made a small test cmd to mount the new filesystem as I have found i cannot just add it to the fstab as that will just mount to the existing externel flash:
FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(nvs_storage_data);
static struct fs_mount_t littlefs_mnt = {
.type = FS_LITTLEFS,
.fs_data = &nvs_storage_data,
.storage_dev = (void *)FIXED_PARTITION_ID(nvs_storage),
.mnt_point = "/nvs",
};
void cmd_test(const struct shell *shell, size_t argc, char **argv) {
shell_print(shell, "Test command");
int rc = fs_mount(&littlefs_mnt);
if (rc != 0) {
shell_error(shell, "Error mounting as littlefs: %d", rc);
return;
}
}
I have defined the partition in my dts:
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x0 0x20000>;
};
slot0_partition: partition@20000 {
label = "image-0";
reg = <0x20000 0xc0000>;
};
nvs_storage: partition@e0000 {
label = "nvs_storage";
reg = <0xe0000 0x20000>;
};
};
};
When i run my test command the code errors out in:
lfs_dir_fetchmatch