-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32-S3 - Data from USB CDC gets randomly corrupted #209
Comments
Hello! I can try and look at this more closely tomorrow. In the meantime, what version of esp_littlefs are you running? I just saw that Geky released a (possibly unrelated) bugfix in the littlefs core codebase. I'll release a patch release updating the littlefs submodule to that tomorrow. |
Hi, thank you for the hyper-fast response! I'm using the latest stable Now that you have suggested it, I manually upgraded the submodule I'll report back after some testing. |
what might also be helpful is turning on verbose-level logs for esp_littlefs:
|
The last update has fixed the issue. Thank you for the support! |
Hi, thank you for the great work on this module!
I've just implemented it on our project but we are facing random corruption of the data when writing to the filesystem.
Our communication system isn't super trivial but I'll make my best to explain it.
We use the esp_timer to check every 10ms if a json rpc message has been received via USB CDC, if so, we parse and pass it to the relevant handler. The data is in base64 and then decoded runtime by the function below.
The flow is as follows:
unlink
)The weird thing that is happening is that after some time (or event, I honestly don't know), every file we send (and write to littlefs) gets corrupted and only a complete format of the partition fixes it. After some time it starts to happen again.
By corrupted I mean shifted, the data seems ok but its completely shifted all over the place with the wrong offsets.
The partition is 2MiB and currently it just has two files:
file.json ~16K
andfile.bin ~80K
.The firmware and the pc software remain the same, the only thing that changes is the littlefs partition that gets formatted.
During those tests I've also re-flashed the firmware but the littlefs partition isn't included in the image.
Do you have any idea on what could be causing this or what steps I could try to troubleshoot the issue? Thank you in advance.
Function that writes from json rpc to flash:
The text was updated successfully, but these errors were encountered: