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

stm32: Add workaround for STM32 i2cv1 errata #2887

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

jamesmunns
Copy link
Contributor

@jamesmunns jamesmunns commented Apr 29, 2024

Applies to #2372, and may be ONE of the root causes.

This partially addresses the STM32F405 (and likely all other i2cv1) errata that if the device thinks it hears a STOP at the wrong time, it'll refuse to ever send a START again, causing all i2c transactions to lock up.

Ideally we'd do this at runtime, not to force users to re-configure their devices like I do, but then we'd need to hold onto the config, detect the lockup (timeout on read/write? check the BUSY flag is set when it shouldn't?), wait for the bus to be idle, apply the workaround, reapply config (as swrst resets the peripheral config), and start again.

At least now users can clear the fault by re-initializing the I2C device within their firmware.

Screenshot 2024-04-29 at 12 02 08

Copy link
Member

@Dirbaio Dirbaio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oof that errata

@Dirbaio Dirbaio added this pull request to the merge queue Apr 29, 2024
Merged via the queue into embassy-rs:main with commit 679160a Apr 29, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants