Driver: I2C: STM32F2/STM32F4/STM32L1: Fix alternate i2c read. #14668
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.
This commit fixes the i2c driver issue reported in #13967 on STM32F2xx, STM32F4xx & STM32L1xx series.
fix #13967
Signed-off-by: Krishna Mohan Dani krishnamohan.d@hcl.com
Summary of changes
As issue describes, every alternate i2c read was failing. On the bus side there was no transaction of alternate i2c read, the state machine (
PreviousState
) prevented to trigger START condition of second transaction as the first transaction did not end it cleanly, thePreviousState
was still set asI2C_STATE_MASTER_BUSY_RX
although the first transaction was complete. In the second transaction as START condition did not occur, the second transaction timesout followed by a reset of the entire i2c hal which also resets the state machine PreviouState, due to this the third transaction is successful and this cycle repeats.Impact of changes
So this PR sets
PreviousState = I2C_STATE_NONE
in the master receive complete callback function to indicate completion of receive and that bus is idle.The data type of XferOperation has been changed from uint8_t to uint32_t
so that it can hold a 32bit value (for example: I2C_OTHER_FRAME or
I2C_OTHER_AND_LAST_FRAME).
Migration actions required
Documentation
Pull request type
Test results
Reviewers