Skip to content
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

Fixes I2C hal issues #2826

Merged
merged 1 commit into from
Sep 4, 2024
Merged

Fixes I2C hal issues #2826

merged 1 commit into from
Sep 4, 2024

Conversation

XuGuohui
Copy link
Member

@XuGuohui XuGuohui commented Sep 4, 2024

Problem

  1. Gen3: I2C slave RX buffer may have stale data if the last rx operation failed.
  2. Gen4: I2C master may fail to re-enable due to I2C FSM(Realtek's concept: Finite State Machine) state never changes to idle

Solution

  1. Reset buffer state on write-request received or error encountered
  2. Abort master operation before disabling the I2C module and checks the IC_ENABLE_STATUS flag, instead of the activity flag. If we don't abort master operation and only switch to check the IC_ENABLE_STATUS flag, the following I2C master operation will fail with abort source ABRT_MASTER_DIS.

Steps to Test

Run the i2c_master_slave fixture test

Example App

user/tests/wiring/i2c_master_slave

References

N/A


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@XuGuohui XuGuohui added this to the 5.9.0 milestone Sep 4, 2024
@avtolstoy avtolstoy merged commit edee476 into develop Sep 4, 2024
13 checks passed
@avtolstoy avtolstoy deleted the fix/i2c_hal branch September 4, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants