Address Errata 2.19.4 In I2C HAL Driver#28
Open
matt001k wants to merge 1 commit into
Open
Conversation
As per errata 2.19.4: Description: In master mode, a bus error can be detected spuriously, with the consequence of setting the BERR flag of the I2C_SR register and generating bus error interrupt if such interrupt is enabled. Detection of bus error has no effect on the I2C-bus transfer in master mode and any such transfer continues normally. Workaround: If a bus error interrupt is generated in master mode, the BERR flag must be cleared by software. No other action is required and the ongoing transfer can be handled normally. This code ignores a bus error if in master mode, allowing operations to continue as intented as per the workaround.
db53fe5 to
eccb0b5
Compare
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.
As per errata 2.19.4:
Description:
In master mode, a bus error can be detected spuriously, with the consequence of setting the BERR flag of the I2C_SR register and generating bus error interrupt if such interrupt is enabled. Detection of bus error has no effect on the I2C-bus transfer in master mode and any such transfer continues normally.
Workaround:
If a bus error interrupt is generated in master mode, the BERR flag must be cleared by software. No other action is required and the ongoing transfer can be handled normally.
This code ignores a bus error if in master mode, allowing operations to continue as intented as per the workaround.
Why?
I brought this up in #27, but it is imperative that I do not patch the HAL locally, as with newer versions, there is a risk that that the changes are wiped. CubeMX does not care if I made these changes locally and will blow them away if updating the HAL version. This update would reduce a maintenance burden whenever the HAL is updated to the newest version.