-
Notifications
You must be signed in to change notification settings - Fork 16.8k
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
AP_Logger: fix locking issues, log wrapping and status messages #13178
Conversation
I think there may still be a problem if your flight is long enough to wrap a single log, but not proved this yet. |
@rmackay9 FYI |
Ok, if I set log disarmed to 1 and just wait until the log wraps it's pretty easy to show the problems. I then end up with:
and maxproxy reports:
I will investigate more. Interestingly my checking code thinks everything is fine. |
…length account for erased partial sectors when looking at wrapped logs
e5f4a45
to
46251e7
Compare
Ok, I have it. We weren't accounting for the fact that when we wrap a log we erase blocks as we go, so there is a deadzone between the end of the last log and the start of the first log that is filled with 0xFFFF which confuses all of the logic around finding log numbers and pages. The solution is to make sure we skip this deadzone when looking for the start of the first log. In @tridge 's defense I think that the original code may have had some allowance for this, but in fixing some of the other issues I clearly undid that logic. The PR now works with wrapped files. |
@tridge I'm pretty confident in this now. I have created multiple logs via LOG_DISARMED and rebooting and then continuously done "log list" from mavlink with this on. This has correctly detected the wrap and then also has correctly detected the number of logs (reducing) as they gradually get overwritten. Pretty happy with this change now. @rmackay9 FYI. |
FYI, this is included in Copter-4.0.2-rc4 |
This is a follow-up to #13130
I was getting hangs in chip erase which lead to corrupted logs. This PR fixes this problem.
It also shortens some of the status messages so that they can be seen.
Tests done:
All pass except the last one. So if you erase the chip you need to reboot to get logging to work again. This seems like a small inconvenience and nothing actually breaks in all these tests