fix(PeriphDrivers): Fix STOP and repeated START handling in I2C RevA #1640
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.43) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 388 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.357
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1640"
general
weight: 0.35
ttmut
Description
A blocking I2C RevA transaction returns while its STOP is still on the bus, because
MSTCTRL.STOPclears when the STOP starts, not when it ends. TheSTATUS.BUSYcheck added in #1359 then rejects the next transaction with E_BUSY, so even two blocking reads back-to-back fail. A transaction that ends in a repeated START (restart = 1) leavesSTATUS.BUSYset: the next blocking call returnsE_BUSY, and the next async call waits forever in the busy check added in #1416.MXC_I2C_RevA_Stop()now waits forSTATUS.BUSYto clear. The blocking transaction, the async interrupt handler, and the DMA callback all end through it, so the STOP has finished before the call returns or the callback returns.MXC_I2C_RevA_MasterTransaction()andMXC_I2C_RevA_MasterTransactionASync()ignoreSTATUS.BUSYwhen STATUS.MST_BUSY is also set, which means this controller still holds the bus after its own repeated START.MXC_I2C_Start(). The repeated START is already on the bus, and requesting another one put an empty Sr-Sr on the bus.MXC_I2C_RevA_MasterTransactionAsync()setsRXCTRL1before loading the read address, because after a repeated START the controller sends the address as soon as it is in the FIFO.Checklist Before Requesting Review
Testing
Testing was done on a MAX32655FTHR and a MAX32690EVKIT. The test suite runs 14 test cases of 1000 transactions each back-to-back. The test suite was run against
v2023_06,v2023_10,v2024_02,v2024_10,main, and local copies of the Maxim SDK supplied with CFS 2.1.0 and CFS 2.3.0. More details can be found here:The code for testing can be found here:
Results can be found here: