This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Not able to combine OpenThread, MCUBoot and LittleFS

Hi,

I'm trying to combine OpenThread, MCUBoot and LittleFS in a sample in nRF Connect SDK v1.5.1, but I'm getting the following error:

C:/ncs/v1.5.0/nrf/include/flash_map_pm.h:29:2: error: #error "Not supported"
   29 | #error "Not supported"

I have checked the file, and it seems to suggest that combining NVS (used by OpenThread/settings module for storing network data) with LittleFS is not supported:

#if (CONFIG_SETTINGS_FCB || CONFIG_SETTINGS_NVS) && CONFIG_FILE_SYSTEM_LITTLEFS
#error "Not supported"
#endif

I can reproduce this issue by adding the following configs to the Zephyr LittleFS sample prj.conf file:

CONFIG_BOOTLOADER_MCUBOOT=y

CONFIG_NET_L2_OPENTHREAD=y
CONFIG_NETWORKING=y

Is there any ways I can successfully combine these modules?

Parents
  • Hi,

    The error generated in flash_map_pm.h is only generated to guard the definition of the 'storage' symbol defined above, to make sure that the symbol is set and used correctly. 

    If you redefine the littlefs_storage variable on line 23 to lfs_storage, like this:

    #if (CONFIG_SETTINGS_FCB || CONFIG_SETTINGS_NVS)
    #define storage settings_storage
    #elif CONFIG_FILE_SYSTEM_LITTLEFS
    #define lfs_storage littlefs_storage
    #elif CONFIG_NVS
    #define storage nvs_storage
    #endif
    ,

    Then you can remove the error check:

    //#if (CONFIG_SETTINGS_FCB || CONFIG_SETTINGS_NVS) && CONFIG_FILE_SYSTEM_LITTLEFS
    //#error "Not supported"
    //#endif

    You can then replace the 'storage' symbol in the LittleFS application with littlefs_storage symbol:

    static struct fs_mount_t lfs_storage_mnt = {
    	.type = FS_LITTLEFS,
    	.fs_data = &littlefs_storage,
    	.storage_dev = (void *)FLASH_AREA_ID(storage),
    	.mnt_point = "/lfs",
    };

    I have attached patches that enables the modules in the sample and resolves the error, one for Zephyr and one for the nRF repository. Both needs to be applied:

    littlefs_zephyr.patch

    littlefs_nrf.patch

  • The patch you provided works, but it requires commits to both Zephyr and NRF repos.

    Is this a good fix? if so, is Nordic going to apply it to the repos?

    Alternatively could all the settings (including OpenThread, BT,etc.) be switched over to using FS/LFS?

Reply Children
No Data
Related