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

Running LittleFS and Openthread.

Hi,

I'm trying to get LittleFS up and running while also using Openthread. I've encountered an issue regarding the SETTINGS subsystem that is enabled by Openthread. I've tried opening a private ticket regarding this but it does not seem to get answer so I try with a public one.

First I built the littleFS sample in the zephyr tree and flashed a nrf52840dk which worked as expected.

When I add openthread to the sample using

CONFIG_NET_L2_OPENTHREAD=y
CONFIG_NETWORKING=y

The build fails stating

In file included from ../../../../../include/storage/flash_map.h:244,
                 from C:/ncs/v1.4.0/zephyr/subsys/storage/flash_map/flash_map_default.c:11:
C:/ncs/v1.4.0/nrf/include/flash_map_pm.h:29:2: error: #error "Not supported"
   29 | #error "Not supported"
      |  ^~~~~

Which seesm to be due to NVS and LittleFS not being able to be enabled at the same time.

I tried to work around this using

CONFIG_SETTINGS_FS=y

And it makes the project build successfully.

However, when I  flash the device I get the following error:

*** Booting Zephyr OS build v2.4.0-ncs1  ***
[00:00:00.394,561] <inf> mcuboot: Starting bootloader
[00:00:00.401,031] <inf> mcuboot: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
[00:00:00.411,437] <inf> mcuboot: Boot source: none
[00:00:00.417,205] <inf> mcuboot: Swap type: none
[00:00:00.481,262] <inf> mcuboot: Bootloader chainload address offset: 0xc000
[00:00:00.489,257] <inf> mcuboot: Jumping to the first image slot
*** Booting Zephyr OS build v2.4.0-ncs1  ***
Area 6 at 0xf4000 on NRF_FLASH_DRV_NAME for 24576 bytes
/lfs mount: 0
/lfs: bsize = 16 ; frsize = 4096 ; blocks = 6 ; bfree = 4
/lfs/boot_count stat: -2
/lfs/boot_count read count 0: 0
/lfs/boot_count seek start: 0
/lfs/boot_count write new boot count 1: 4
/lfs/boot_count close: 0
/lfs opendir: 0
  F 4 boot_count
End of files
/lfs unmount: 0


[00:00:00.621,673] <err> fs: fs_open:mount point not found!!
[00:00:00.623,016] <err> fs: fs_open:mount point not found!!
[00:00:00.626,861] <err> fs: fs_open:mount point not found!!
[00:00:00.632,232] <err> fs: fs_open:mount point not found!!
[00:00:00.636,505] <err> fs: fs_open:mount point not found!!
[00:00:00.637,420] <inf> littlefs: LittleFS version 2.2, disk version 2.0
[00:00:00.637,634] <inf> littlefs: FS at NRF_FLASH_DRV_NAME:0xf4000 is 6 0x1000-byte blocks with 512 cycle
[00:00:00.637,634] <inf> littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
[00:00:00.637,756] <err> littlefs: WEST_TOPDIR/modules/fs/littlefs/lfs.c:997: Corrupted dir pair at {0x0, 0x1}
[00:00:00.637,756] <wrn> littlefs: can't mount (LFS -84); formatting
[00:00:00.809,265] <inf> littlefs: /lfs mounted
[00:00:00.809,326] <err> fs: fs_open:mount point not found!!
[00:00:00.812,622] <err> fs: fs_open:mount point not found!!
[00:00:00.817,810] <err> fs: failed get file or dir stat (-2)
[00:00:00.837,738] <inf> littlefs: /lfs unmounted
[00:00:01.181,518] <err> fs: fs_open:mount point not found!!

My prj,conf is the following:

#
# Copyright (c) 2019 Peter Bigot Consulting, LLC
#
# SPDX-License-Identifier: Apache-2.0
#

# Optionally force the file system to be recreated
#CONFIG_APP_WIPE_STORAGE=y

# fs_dirent structures are big.
CONFIG_MAIN_STACK_SIZE=2048

# Let __ASSERT do its job
CONFIG_DEBUG=y

CONFIG_LOG=y

CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_FLASH_PAGE_LAYOUT=y

CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y
CONFIG_SETTINGS_FS=y
CONFIG_BOOTLOADER_MCUBOOT=y

CONFIG_NET_L2_OPENTHREAD=y
CONFIG_NETWORKING=y

I am running on a nrf52840dk and using NCS1.4.

What do I have to do to get Openthread and LittleFS to run without any errors?

Related