Skip to content

Address Errata 2.19.4 In I2C HAL Driver#28

Open
matt001k wants to merge 1 commit into
STMicroelectronics:masterfrom
matt001k:fix/errata_2_19_4
Open

Address Errata 2.19.4 In I2C HAL Driver#28
matt001k wants to merge 1 commit into
STMicroelectronics:masterfrom
matt001k:fix/errata_2_19_4

Conversation

@matt001k

@matt001k matt001k commented Jun 2, 2026

Copy link
Copy Markdown

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.

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.
@matt001k matt001k force-pushed the fix/errata_2_19_4 branch from db53fe5 to eccb0b5 Compare June 2, 2026 22:35
@ALABSTM ALABSTM added bug Something isn't working hal HAL-LL driver-related issue or pull-request. i2c Inter-Integrated Circuit interface labels Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working hal HAL-LL driver-related issue or pull-request. i2c Inter-Integrated Circuit interface

Projects

Development

Successfully merging this pull request may close these issues.

3 participants