9160's littlefs cannot correctly read files generated by littlefs Python

After enabling Littlefs, I wanted to use a serial port to write files to it. I first tried using mcumgr, but currently encountered some problems. So, I tried to directly read the data from the LFS partition, modify it, and write it again.

After reading the data from the LFS partition of 9160, I used the littlefs Python library to parse the data and correctly identify the files and directories in the data package. Then, I used this library to create a file in the data package, and finally wrote the newly created file into the LFS partition of 9160 again. After restarting, most of the time, it would prompt an LFS mount failure with an error code of -84. Sometimes it is possible to successfully mount, but LFS cannot recognize the files or directories inside.  There are still a few successful mounts that can recognize the files inside. (I did not use the Python library to add files to the read data during the successful mount and correct recognition. Instead, I wrote an independent LFS packet directly into the LFS partition, and LFS could recognize both the existing files and the files in the independent packet at the same time)

I have analyzed the data packet and feel that it is possible that the littlefs Python library has damaged the part of the LFS operation log that records the operation logs. I can't find the pattern, and I don't know why there were those successful situations

This is the independent LFS data packet I am using
6471.lfs2.bin

Link to the littlefs library: https://github.com/jrast/littlefs-python

Can you help me analyze this problem? Thanks

Related