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

littlefs sample on Thingy:91

Hi,

I've been trying to run the zephyr's littlefs sample on Thingy:91 under the ncs 1.2.0 tag, but it seems that the flash_open_area function is having some trouble, and it returns

FAIL: unable to find flash area 6: -2

where 6 is the ID of flash partition. Previously I've managed to succesfully run the NVS sample, which I believe uses the same flash partition - the nvs uses the DT_FLASH_AREA_STORAGE_OFFSET variable and littlefs uses the DT_FLASH_AREA_STORAGE_ID variable which are both defined in the same devicetree_unfixed.h group of defines related to one flash area.

Manually changing the id to 1 or 2 allows succesfully opening the flash area, but then causes the MPU fault and returns what follows:

Area 1 at 0xc000 on NRF_FLASH_DRV_NAME for 974848 bytes



[00:00:00.009,338]

[0m<inf> littlefs: LittleFS version 2.1, disk version 2.0

[0m



[00:00:00.009,552]
[0m<inf> littlefs: FS at NRF_FLASH_DRV_NAME:0xc000 is 238 0x1000-byte blocks with 512 cycle
[0m



[00:00:00.009,552]

[0m<inf> littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32

[0m


[00:00:00.009,643] 

[1;31m<err> littlefs: Corrupted dir pair at 0 1

[0m



[00:00:00.009,643]

[1;33m<wrn> littlefs: can't mount (LFS -84); formatting

[0m



[00:00:00.009,704]

[1;31m<err> os: ***** MPU FAULT *****

[0m



[00:00:00.009,704]

[1;31m<err> os:   Data Access Violation

[0m



[00:00:00.009,704]

[1;31m<err> os:   MMFAR Address: 0xc000

[0m



[00:00:00.009,735]

[1;31m<err> os: r0/a1:  0x00000001  r1/a2:  0x00001000  r2/a3:  0x00000002

[0m



[00:00:00.009,735]

[1;31m<err> os: r3/a4:  0xffffffff r12/ip:  0x000004ff r14/lr:  0x0001151b

[0m


[00:00:00.009,765] 

[1;31m<err> os:  xpsr:  0x01000000

[0m



[00:00:00.009,765]

[1;31m<err> os: Faulting instruction address (r15/pc): 0x0001151e

[0m



[00:00:00.009,796]

[1;31m<err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0

[0m
[00:00:00.009,796]

[1;31m<err> os: Current thread: 0x20020418 (unknown)

[0m



[00:00:00.112,915]

[1;31m<err> os: Halting system

[0m

To run the sample I copied the src directory, prj.conf and CMakeLists.txt files into a new folder in nrf/samples/nrf9160 directory.
What can be the cause of that behaviour?
Is it lacking some configuration?
Related