ism330dlc: I2C errors are hidden in the polling example
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 67/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- c
- Lĩnh vực
- embedded-iot, testing-qa
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- C
- Star
- 888
- Fork
- 540
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của STMicroelectronics/STMems_Standard_C_drivers
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
STMicroelectronics/STMems_Standard_C_drivers#184 · 2 reaction ·
-
LSM6DSV320X: Provide SFLP example + quaternion-to-Euler reference (120 Hz, INT1 DRDY gating)Đang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
ISM330DLC FIFO exampleĐang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
question
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
Tất cả issue của STMicroelectronics/STMems_Standard_C_drivers
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Polprzewodnikowy/N64FlashcartMenu#486 · 3 bình luận ·
-
crash
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
`core.output` prints string properties without escaping their quotesCó thể đã có người làm @JensOgorek đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
zauberzeug/lizard#399 ·
Maintainer thường phản hồi trong vòng 2 ngày