This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

littlefs sample on nrf5340dk not running

Hello,

I would like to use littlefs on the nrf5340dk board with the OnBoard Flash. So I selected the Zephyr/samples/subsys/fs/littlefs sample Project with the nrf5340dk board. Unfortunately the sample Project contains only nrf52840dk_nrf52840 conf and overlay files. So I renamed them to nrf5340dk_nrf5340_cpuapp and everything compiled.

The Flash area seems to be existing as the Flash_area_open/close functions in the beginning of main.c work. But the rest, which is the real stuff I would like to use not.

fs_statvfs Reports an error as could not find a mount Point fs_mnt_list, which is even empty. According main.c it seems that it should have been automounted. But that seems not to be the case. When I therefore include a call of fs_mound(mp), the call is also not successfully. This function tries to get a Flash device, which is not existing. So that doesn't work either.

It seems that some configuration (in device tree or prj.conf) is missing.

Can someone help me to get a Project that uses the DK OnBoard Flash as file System?

BTW: I'm using nRF Connect SDK v1.9.0

Regards
Erwin

  • Hi Erwin

    I ran the littlefs sample with the added board files as you described. It seems to run fine at my end, but I might have missed something.
    You might have to reset the device once after flashing before it works.

    Could you send the serial log from the littlefs sample?
    (use insert->code in the editor)

    Regards,
    Sigurd Hellesvik

  • Here is the output

    Area 0 at 0x0 on MX25R64 for 65536 bytes
    /lfs1 automounted
    FAIL: statvfs: -2
    /lfs1 unmount: -22
    [00:00:00.249,755] <inf> littlefs: littlefs partition at /lfs1
    [00:00:00.249,786] <inf> littlefs: LittleFS version 2.4, disk version 2.0
    [00:00:00.249,786] <err> littlefs: can't get flash device: MX25R64
    [00:00:00.249,816] <err> fs: fs mount error (-19)
    [00:00:00.249,816] <err> littlefs: Automount /lfs1 failed: -19
    [00:00:47.808,532] <err> fs: mount point not found!!
    [00:00:47.810,211] <err> fs: fs not mounted (mp == 0x20000138)

  • Hello,

    I thought it doesn't harm to upload the whole Project. It's practically the sample Project except that I copied and renamed the conf and overlay file to the nrf5340 board.

    1134.littlefs.zip

    May be someone gets it running on the development board.

    Erwin

  • Hi

    Good idea to upload your project!
    I tried to run your project,  and I get the same error as you.

    So I selected the Zephyr/samples/subsys/fs/littlefs sample Project with the nrf5340dk board.

    Did you edit the project, other than changing the names of the overlay files?

    Anyhow, here is my edited littlefs project,

    Here is the littlefs sample(from zephyr) where I have only added overlay files:

    littlefs2.zip

    EDIT: Clarified some of my writing

    Regards,
    Sigurd Hellesvik

  • Before simply trying it: ist littlefs2.zip running on your side on a nrf5340dk board?

Related