BUG - shell fs command mounts the incorrect storage partition

I'm using Asset Tracker V2

with the Settings Enabled and tsetting up an external littlefs storage area. 

I want to use the shell built in command "fs" to write stuff to the lttlefs storage area. 

When I mount it. the shell is selecting the "settings" storage area instead of the "littlefs" storage area. 

fs mount littlefs /lfs
[11:40:06.395,477] <inf> littlefs: LittleFS version 2.5, disk version 2.0
[11:40:06.395,690] <inf> littlefs: FS at flash-controller@39000:0xf8000 is 2 0x1000-byte blocks with 512 cycle
[11:40:06.395,721] <inf> littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
[11:40:06.395,812] <err> littlefs: WEST_TOPDIR/modules/fs/littlefs/lfs.c:1234: Corrupted dir pair at {0x1, 0x0}
[11:40:06.395,843] <wrn> littlefs: can't mount (LFS -84); formatting
[11:40:06.574,920] <inf> littlefs: /lfs mounted

the file "nrf\include\flash_map_pm.h" is the cause. 

#if (CONFIG_SETTINGS_FCB || CONFIG_SETTINGS_NVS || defined(PM_SETTINGS_STORAGE_ID))
#define storage settings_storage
#define storage_partition settings_storage
#elif CONFIG_FILE_SYSTEM_LITTLEFS
#define storage littlefs_storage
#define storage_partition littlefs_storage
#elif CONFIG_NVS
#define storage nvs_storage
#define storage_partition nvs_storage
#endif

as "zephyr\subsys\fs\shell.c" uses this storage partition to load the correct partition. 

#define STORAGE_PARTITION	storage_partition
#define STORAGE_PARTITION_ID	FIXED_PARTITION_ID(STORAGE_PARTITION)

What should I do to correct itand ensure that the settings still continue to work. 

for now I've just changed "zephyr\subsys\fs\shell.c" to 

#define STORAGE_PARTITION littlefs_storage 
It's selecting the correct partition, however it's messing with the zephyr source, so not very upgradeable.
[00:01:36.994,567] <inf> littlefs: LittleFS version 2.5, disk version 2.0
[00:01:36.995,208] <inf> littlefs: FS at is25lp032d@0:0xe8000 is 512 0x1000-byte blocks with 512 cycle
[00:01:36.995,239] <inf> littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
[00:01:37.316,192] <inf> littlefs: /lfs mounted

Thanks 

Marshall

Parents Reply Children
No Data
Related