I2C transaction breaks I2c trait contract
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- linux, rust
調査の方向性
I2cdev::transaction の実装から開始し、提供されたサンプルで使用される Linux I2C の動作経路を追跡します。生成されたバスシーケンスをトランザクション契約と比較し、特に隣接する Write 操作を確認します。サンプルが連続する書き込みの間に不要な repeated start とアドレスを生成しなくなり、実装がテスト可能な経路を提供している場合は関連する動作がテストでカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
According to I2c trait transaction contract is as follows:
Transaction contract:
- Before executing the first operation an ST is sent automatically. This is followed by SAD+R/W as appropriate.
- Data from adjacent operations of the same type are sent after each other without an SP or SR.
- Between adjacent operations of a different type an SR and SAD+R/W is sent.
- After executing the last operation an SP is sent automatically.
- If the last operation is a `Read` the master does not send an acknowledge for the last byte.
- `ST` = start condition
- `SAD+R/W` = slave address followed by bit 1 to indicate reading or 0 to indicate writing
- `SR` = repeated start condition
- `SP` = stop condition
Using following simple test code:
use embedded_hal::i2c::blocking::{I2c, Operation as I2cOperation};
use linux_embedded_hal::I2cdev;
fn main() {
let mut i2c_dev = I2cdev::new("/dev/i2c-1").unwrap();
let data = [0xaa; 1];
let mut ops = [I2cOperation::Write(&[0x40]), I2cOperation::Write(&data)];
i2c_dev.transaction(0x3d, &mut ops).unwrap();
}
I'm expecting no SR "repeated start condition" to appear as both operations are of the same type (Write). Unfortunately I can see SR "repeated start condition" on the bus as well as SAD+R/W "slave address followed by bit 1 to indicate reading or 0 to indicate writing" (positions 6 and 8). This was captured using logic analyzer on embedded Linux board for the sample code attached above:

- 主要言語
- Rust
- スター
- 319
- フォーク
- 60
- 平均マージ
- 12時間 31分
- マージ済み PR(30日)
- 1
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-embedded/linux-embedded-hal のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
rust-embedded/linux-embedded-hal#121 · コメント 4 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
rust-embedded/linux-embedded-hal#117 · リアクション 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
rust-embedded/linux-embedded-hal#116 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
rust-embedded/linux-embedded-hal の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
nautechsystems/nautilus_trader#5095 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
stellar/rs-soroban-env#1739 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bug good first issue package: quic
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100