-
Notifications
You must be signed in to change notification settings - Fork 17.2k
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
Harden flash handling in AP_Logger #13130
Conversation
515657d
to
f160f95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for working on this!
Also @tridge I have seen AP_Logger_Block::find_last_page_of_log() return 0, when would this ever be the case (and it was not because the file wrapped)? |
f794d0c
to
a4d29de
Compare
Ok @tridge I've addressed your comments and fixed some bugs I found. I was successfully able to recover a log from a KakuteF7Mini with this which before caused mission planner to hang. |
a4d29de
to
53448d4
Compare
And yet another bug found and fixed. Turns out our mavlink listing support (used by mission planner) did not cope with wrapping |
be really careful to catch aborted erases take care to protect shared structures in io thread if flash corruption is detected try and recover whole files overwrite format in erase to make sure erase happens output useful messages at critical times a block is 64k a sector is 4k, rename internal variables appropriately cope with log wrapping when sending log listings over mavlink
53448d4
to
199893f
Compare
I suspect we should backport this to the 4.0 branches (or at least Copter)? |
@rmackay9 I agree, although it woud be nice to have a report that nothing has regressed. That said it's only small copters using these boards and the status quo in 4.0 is pretty broken. |
@rmackay9 I am still seeing issues - I don't suggest you backport it at this time. |
FYI, this is included in Copter-4.0.2-rc4 |
This PR did very bad things to log downloads in SITL. I wouldn't be surprised to know it's killed it on HW - I haven't tested yet. Before:
After:
The PR removed the distinction between log-on-disk and log-in-mavlink-packet - perhaps accidentally, perhaps not. Either way, SITL is looking for the wrong files. |
It definitely works in hardware beacuse that was my specific use case that I tested and that did not work before. Even so - oops, mea culpa. |
How would it have removed that distinction? |
I can't reproduce what you are seeing. On current master:
|
@andyp1per Try deleting the oldest 5 logs. |
Ah yes that fails like you have. So it must be to do with the reading rather than storage since we have seen that the data is there. |
Ok, if I comment out the changes to AP_Logger_MAVLinkLogTransfer.cpp I get data
but that will break FRAM-based logging list which this fixed. So somehow we need the happy medium of both. |
This seems to be affecting log downloads |
The issues were fixed in #14299 |
This PR addresses a number of issues in the dataflash handling which I would appreciate feedback on: