I2C wait end of stop before start#883
Conversation
|
At the risk of muddying the waters with an unrelated issue, this might be related ;-). We had an issue where a I2c write followed by an I2c read would result in a timeout for the read for some reason. Adding a delay between the two transactions fixed the problem, so this sounds like it might at least be related. Here's a trace I made: Green dots are starts, red dots are stops. You can see a stop ollowed by a start at the right, which starts the read transaction. However, it is cut short after the first clock pulse where a stop is done and then nothing happens (until a timeout after 100ms). What's notable is that the one clockpulse that happens is actually 6us rather than 5us as all others are. I suspected this might be the slave stretching the clock, but that did not make too much sense. Reading this, I wonder if maybe somehow the start is done when a (second?) stop is still pending, causing the transaction to start and immediately stop again. If this report helps clarify things: Great. If it does not make sense, then just ignore it, we'll be more thoroughly investigating this issue on our hardware later (but we need to get a usable release out first next week). I will see if I can quicktly test whether this PR fixes our problem next week. |
|
@matthijskooijman, |
be5d074 to
709dbc2
Compare
|
Official patch ready for all concerned STM32 families F1, F2, F4 and L1. |
|
We've just tested this on our hardware, and it seems this fix indeed fixes the problem we were seeing as well. Thanks! |

Summary
Wait for end of I2C STOP before starting a new transfer.
Fixes #864