little fs directory disappears after having used it for ~20-30 hours

Hi,

we are working on a nrf52840 based device, which has an external mx25r16 flash (via SPI), having 3 partitions for: secondary-image, mcu-scatch-partition and application-data-partition with litte-fs.

Our device is based on zephyr 2.4 (...knowing that this is quite old).

Recently we added a flash-file based event-logging feature to our application, where various events are logged to an increasing number of event-log-files (located in one log-subdirectory).

These event-log files are published to some cloud service one-by-one about two times per day and are deleted after successful publishing.

The implementation seems to work perfectly, when having a debug build with various LOG_INF()s.

As soon as running in release build we can observe, that on about 40% of our devices are not sending any event-log-files anymore after having run for about 20-30 hours, even while everything worked fine within the time between reboot and the first occurrence of the problem.

When digging into the problem, we found out, that all of the affected devices do not have the logging-subdirectory anymore, which was created on demand during the app-initialization after reboot.

We reviewed our application very carefully and are sure, that there is no line of application-code which might cause the delete of the logging-subdirectory.

Is there known any filesystem / little fs issue, which might cause this kind of problem?

Any help or suggestion is highly appreciated!

Volker

  • In the meantime, there are running 17 testing-devices with the zephyr 3.2 version for several days without showing the problem. So it is quite likely that the problem was somewhere in little-fs or the surrounding zephyr-code.

    I tried to inspect the diff, but especially in the little-fs-component there are so many differences, that I was not able to track down the one, which might have caused our problem.

    I cannot believe that we are the first and only ones having this problem ...

  • This sounds very promising, thanks for the update. Yes, it is surprising that we have not found any other reports of this issue. Maybe there is something with the timing in your app that makes it easier to reproduce.

Related