Skip to content
Commit 8b33da03 authored by Dmytro Semenets's avatar Dmytro Semenets Committed by Carles Cufí
Browse files

fs: shell: littlefs: add support of block devices



For flash device, littlefs should be located at the partition.
Current implementation of the fs shell is hardcoded for the flash device
and the compilation fails if STORAGE_PARTITION isn't defined in the
device tree.
Add options for block dev support. This allows to mount littlefs on the
block device from the shell, and also removes the compile time
dependency on STORAGE_PARTITION, if CONFIG_FS_LITTLEFS_BLK_DEV is set.

Fix mounting of littlefs blk device. lfs_mount stucks in case when the
read/prog buffer less than SDMMC block size, because it can cause memory
corrupt, for example, look into function 'card_read_blocks' how it writes
data to read buffer in case when buffer isn't aligned. With default
config we have 32 bytes in the read buffer but trying to write
'block_size' to it and get memory corrupt, the same issue will be in
case when the read buffer is aligned.

This is an incremental improvement, ideally, someone should implement
selection of the storage dev from the shell args.

Co-authored-by: default avatarMykola Kvach <mykola_kvach@epam.com>
Signed-off-by: default avatarDmytro Semenets <dmytro_semenets@epam.com>
parent 26c9721b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment