AP_Baro: Fix BMP581 abnormal health problem#33111
Open
ZeroOne-Aero wants to merge 2 commits into
Open
Conversation
peterbarker
requested changes
May 19, 2026
Contributor
peterbarker
left a comment
There was a problem hiding this comment.
500ms is a long time to go without data. Any idea how this PR actually fixes the problem?!
| } | ||
| if (memcmp(buf, buf2, ARRAY_SIZE(buf)) != 0) { | ||
| // still inconsistent; use first reading anyway | ||
| } |
Contributor
There was a problem hiding this comment.
If you truly want to compare against the first sample again here - use a for here instead.
... but it seems strange assuming your first sample is the good one.
Contributor
Author
There was a problem hiding this comment.
I suspect data loss occurred when the two comparisons were different, so I'm performing another comparison after the second read. Since I don't fully understand the previous issue, was the second buffer introduced because of the exception during the first read?
Contributor
Author
There was a problem hiding this comment.
It seems a bit unreliable to use the first sample directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a previous issue. #32171


When trying to use the BMP581 on the ZeroOne X6 Air's I2C0, I also encountered bus interference. Sensor data was normal, but the Log's Health was abnormal.
The main problem was that data wasn't refreshed for over 500ms.
This issue was resolved by comparing and reading the sensor data again; currently, all tests are normal now.