LittleFS config creating un-used partition in flash_primary

I am using LittleFS for an external NAND flash by using the KCONFIG option CONFIG_FILE_SYSTEM_LITTLEFS=y and managing the driver implementation manually. This has worked well for me, but I have found that this config option seems to also create an un-used partition on the internal flash_primary shown below:

I assume, since the implementation of littleFS is on external flash, that this is not being used for anything.

I had plans to use some of that flash for an NVS implementation, but having the random partition in the middle of everything complicates it a bit.

Is that partition being used for anything internally? or is there a way to enable use of littleFS without allocating a partition in flash_primary?

Thanks,

- Brett

Parents
  • Hi,

    Could I see the prj.conf of the application? And do you get any errors if you add the following configs?

    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    CONFIG_SETTINGS_NVS=y
    

    If that builds, please check the partition.

  • Here is the relevant section of my prj.conf:

    # file system
    CONFIG_FLASH=y
    CONFIG_FLASH_MAP=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FILE_SYSTEM=y
    CONFIG_FILE_SYSTEM_LITTLEFS=y
    CONFIG_FS_LITTLEFS_BLK_DEV=y
    CONFIG_DISK_ACCESS=y
    CONFIG_DISK_DRIVER_SDMMC=n
    CONFIG_FILE_SYSTEM_MKFS=y

    Adding those config options didn't cause any errors and as expected the settings_storage partition showed up along side the littlefs partition:

    I don't have any doubts that I'll be able to use nvs along side littlefs, I just don't understand why littlefs, when used on external flash, needs to create a partition on internal flash_primary.

  • Ok, you can try one of both of these configs:

    CONFIG_PM_PARTITION_REGION_LITTLEFS_EXTERNAL=y
    CONFIG_PM_PARTITION_SIZE_LITTLEFS=0

    Reducing its size to zero may cause issues with code that uses "storage" or "storage_partition" as defined in flash_map_pm.h instead of "settings_storage" or "nvs_storage", unless you also have a "settings_storage" partition.

Reply
  • Ok, you can try one of both of these configs:

    CONFIG_PM_PARTITION_REGION_LITTLEFS_EXTERNAL=y
    CONFIG_PM_PARTITION_SIZE_LITTLEFS=0

    Reducing its size to zero may cause issues with code that uses "storage" or "storage_partition" as defined in flash_map_pm.h instead of "settings_storage" or "nvs_storage", unless you also have a "settings_storage" partition.

Children
No Data
Related