Skip to content

Don't consider a prior I2C NACK to indicate the bus to be busy #13917

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

Merged
merged 1 commit into from
Sep 22, 2024

Conversation

SteveCEvans
Copy link
Member

On AT32F435 targets if USE_MAG is defined to support an external compass but it's not present then the probe for the magnetometer would terminate with the I2C bus error code reporting I2C_ERR_ACKFAIL.

As this was not I2C_OK the bus was then considered busy and any subsequent access on that bus, to for example a barometer, would be blocked.

This should not be taken to indicate that the bus is busy as the last I2C transaction terminated correctly and the bus is available for the next access.

Copy link

Do you want to test this code? You can flash it directly from Betaflight Configurator:

  • Simply put #13917 (this pull request number) in the Select commit field of the Configurator firmware flasher tab (you need to Enable expert mode, Show release candidates and Development).

WARNING: It may be unstable. Use only for testing!

@haslinghuis haslinghuis added this to the 4.6 milestone Sep 22, 2024
@haslinghuis haslinghuis merged commit c0c24d7 into betaflight:master Sep 22, 2024
27 checks passed
haslinghuis pushed a commit to haslinghuis/betaflight that referenced this pull request Sep 22, 2024
@ledvinap
Copy link
Contributor

@SteveCEvans: What happens when other error is detected during baro discovery? It will make that bus unusable? No reset/retry ?

@SteveCEvans
Copy link
Member Author

@ledvinap Not exactly graceful recovery, but the other errors aren’t expected unless there’s actually a hardware problem.

haslinghuis added a commit that referenced this pull request Sep 24, 2024
#13917) (#13918)

Don't consider a prior I2C NACK to indicate the bus to be busy (#13917)

Co-authored-by: Steve Evans <SteveCEvans@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

5 participants