ism330dlc: I2C errors are hidden in the polling example
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 67/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- c
調査の方向性
Start in ism330dlc_STdC/examples/ism330dlc_read_data_polling.c, focusing on the NUCLEO_F401RE implementations of platform_read() and platform_write() and the configuration and sample-read calls. Trace how callback errors and failed reads are handled before initialization continues or data is interpreted. Done when bus failures are reported and the example stops or skips the corresponding work on failed operations.
索引モデルが issue の本文から書いたものです。
説明
Hi,
I was looking through ism330dlc_STdC/examples/ism330dlc_read_data_polling.c and noticed that the NUCLEO_F401RE versions of platform_read() and platform_write() ignore the HAL return value and always return 0.
Since the driver treats zero as success, an I2C failure gets reported as a successful transaction. I checked this at commit 1f848c38e84b4144d55c66fb5411e78bdb9f96f1, using the pinned ISM330DLC driver.
The example also ignores the return values from its configuration and sample-read calls, so returning the HAL status from the callbacks would only address part of it. The application would still need to check those results before continuing initialization or using the data.
I reproduced the callback behavior with mocked HAL results in a host build. For example, a failed configuration write still allows the rest of setup to run. The driver itself already propagates nonzero errors correctly when the callbacks provide them.
Would you be open to a small change covering this example’s F401RE/I2C configuration? I’d like to:
- Propagate bus failures through the existing callbacks.
- Check configuration calls before continuing initialization.
- Skip status interpretation or sample conversion/output when the corresponding read fails.
For initialization failures, would stopping with a short error message fit the intended scope of the example?
I wanted to check the approach here before preparing a patch.
cc @avisconti
- 主要言語
- C
- スター
- 888
- フォーク
- 540
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
STMicroelectronics/STMems_Standard_C_drivers のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
STMicroelectronics/STMems_Standard_C_drivers#184 · リアクション 2 件 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
question
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
STMicroelectronics/STMems_Standard_C_drivers の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Polprzewodnikowy/N64FlashcartMenu#486 · コメント 3 件 ·
-
crash
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
`core.output` prints string properties without escaping their quotes対応中かも @JensOgorek が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
zauberzeug/lizard#399 ·
メンテナーはふだん 2 日以内に返信