-
As per the issue template for bugs, I'm bringing this to discussion first. I've got an empty project, and I've configured an fstab for littlefs. When I boot the MCU it locks up. If I comment out "automount" and connect and issue shell command "fs mount littlefs /lfs" it will mkfs the filesystem. I've been able to see this on both a sparkfun_pro_micro_rp2040, and a nice_nano_v2(nrf52840) device.
I've created a complete minimal example here: https://github.com/nakato-forks/zephyr-debugging/tree/MkfsOnBootLockup Is this a bug I should submit as an issue or have I done something really silly? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
Hi @nakato, could it be that it just takes a long time ? When the automount is used on a littlefs system it will first try to mount it and only if it fails a format will be performed. It can take littlefs a long time to figure out that there is really no lfs filestem on the flash area, especially if the area is large. |
Beta Was this translation helpful? Give feedback.
-
Hi @nakato, it is a bit confusing for me. Could you try and reformulate the problem. As far as I can tell the auto mount fails and then if it is used as a backend for settings the system hangs. I am however not completely sure this is correct. If I am correct there are 2 problems:
|
Beta Was this translation helpful? Give feedback.
-
I suspect this issue is the same as the one reported in #78729 I downgraded zephyrproject-rtos/littlefs to commit 652f2c5, which has resulted in a working littlefs, with no other changes. I found I could get logs out of the console on boot by inserting a healthy amount of k_sleep(K_MSEC(1000)) into the littlefs format functions, but I have no idea why it's failing. I can put a log message and sleep on line 1991, and it is logged, but a log message and sleep at the very top of the lfs_dir_traverse never shows up, which is called at 1993. I have no idea how to fix the bug, let alone bisect it beyond being able to say |
Beta Was this translation helpful? Give feedback.
-
I updated littlefs back to ca583fd, and on a guess set I think that would make sense why both automount and I presume this is still worth creating an issue for? |
Beta Was this translation helpful? Give feedback.
-
HAVING PROBLEMS WITH LITTLEFS, FIRST TRY INCREASING THE STACK SIZE |
Beta Was this translation helpful? Give feedback.
HAVING PROBLEMS WITH LITTLEFS, FIRST TRY INCREASING THE STACK SIZE