ism330dlc: I2C errors are hidden in the polling example
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 67/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- c
- Área
- embedded-iot, testing-qa
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- C
- Estrellas
- 888
- Forks
- 540
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de STMicroelectronics/STMems_Standard_C_drivers
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 55/100
STMicroelectronics/STMems_Standard_C_drivers#184 · 2 reacciones ·
-
LSM6DSV320X: Provide SFLP example + quaternion-to-Euler reference (120 Hz, INT1 DRDY gating)Abiertoenhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
-
bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
ISM330DLC FIFO exampleAbiertoenhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
question
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
Todos los issues de STMicroelectronics/STMems_Standard_C_drivers
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Polprzewodnikowy/N64FlashcartMenu#486 · 3 comentarios ·
-
crash
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
`core.output` prints string properties without escaping their quotesPosiblemente ocupada @JensOgorek la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
zauberzeug/lizard#399 ·
Los mantenedores suelen responder en 2 días