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:Mykola Kvach <mykola_kvach@epam.com> Signed-off-by:
Dmytro Semenets <dmytro_semenets@epam.com>
Loading
Please sign in to comment