ism330dlc: I2C errors are hidden in the polling example
还没有人认领这个 Issue。
评估
- 难度
- 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 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
STMicroelectronics/STMems_Standard_C_drivers 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 55/100
STMicroelectronics/STMems_Standard_C_drivers#184 · 2 个 reaction ·
-
enhancement
难度 4/5 3-5 天 新手友好度 45/100
-
bug
难度 5/5 一周以上 新手友好度 25/100
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
-
question
难度 5/5 一周以上 新手友好度 20/100
查看 STMicroelectronics/STMems_Standard_C_drivers 的全部 Issue
相似的 Issue
-
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 天内回复
-
难度 2/5 1-3 小时 新手友好度 69/100
维护者通常 5 天内回复