nRF5340 - using NVS and LittleFS

Hi

I can run the sample application for NVS, on the nF5340 DK (SDK 2.9.0)

I can run the sample application for LittleFS, also on the nRF5340 DK

Now I would like to see if I can use both, and share the flash partition - maybe 50/50.

Is this possible.

I read Case ID: 257332 but that is from a few years back.

I tried to set up an overlay and split the partition but I ran in to lots of issues.

Regards

Garrett

Parents
  • Hi, 
    Please try to recover the network core by using: 
    nrfjprog --recover --coprocessor CP_NETWORK

    You may want to recover the application core as well
    nrfjprog --recover --coprocessor CP_APPLICATION

    Which error do you have when you enable both NVS and LittleFS  ? 
    Have you defined a parttition for littlefs ? You can make a pm_static.yml file (copy from a partitions.yml in build folder in littlefs sample for example, and modify it as you wish) to force a partition configuration. You can find the use of pm_static.yml in \nrf\applications\nrf_desktop\configuration\nrf52kbd_nrf52832 for example. 
    It should be in the project folder. 

  • I have it working now.

    I just have a basic version working which uses the code from the NVSA and the LittleFS sample applications.

    My prj.conf file includes these settings:

    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_SETTINGS=y
    #CONFIG_REBOOT=y
    
    
    CONFIG_NVS=y
    CONFIG_NVS_LOG_LEVEL_DBG=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_LOG_MODE_MINIMAL=y
    CONFIG_FILE_SYSTEM=y
    CONFIG_FILE_SYSTEM_LITTLEFS=y

    My pm_static.yml:

    user_littlefs_storage:
    address: 0xfc000
    size: 0x2000
    end_address: 0xfe000
    placement:
    before:
    - end
    region: flash_primary
    user_nvs_storage:
    address: 0xfe000
    size: 0x2000
    end_address: 0x100000
    placement:
    before:
    - end
    region: flash_primary

    So now I can use both, it seems.

    One thing I don't understand.

    If I am correct, this storage area is also used by Bluetooth, for storig pairing/bonding and other information.
    Is this correct?
    If so, how much of this storage area is it safe to re-assign to either NVS or LittleFS?

Reply
  • I have it working now.

    I just have a basic version working which uses the code from the NVSA and the LittleFS sample applications.

    My prj.conf file includes these settings:

    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_SETTINGS=y
    #CONFIG_REBOOT=y
    
    
    CONFIG_NVS=y
    CONFIG_NVS_LOG_LEVEL_DBG=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_LOG_MODE_MINIMAL=y
    CONFIG_FILE_SYSTEM=y
    CONFIG_FILE_SYSTEM_LITTLEFS=y

    My pm_static.yml:

    user_littlefs_storage:
    address: 0xfc000
    size: 0x2000
    end_address: 0xfe000
    placement:
    before:
    - end
    region: flash_primary
    user_nvs_storage:
    address: 0xfe000
    size: 0x2000
    end_address: 0x100000
    placement:
    before:
    - end
    region: flash_primary

    So now I can use both, it seems.

    One thing I don't understand.

    If I am correct, this storage area is also used by Bluetooth, for storig pairing/bonding and other information.
    Is this correct?
    If so, how much of this storage area is it safe to re-assign to either NVS or LittleFS?

Children
No Data
Related