ism330dlc: I2C errors are hidden in the polling example
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 67/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- c
- Ambito
- embedded-iot, testing-qa
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- C
- Stelle
- 888
- Fork
- 540
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di STMicroelectronics/STMems_Standard_C_drivers
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
STMicroelectronics/STMems_Standard_C_drivers#184 · 2 reazioni ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
ISM330DLC FIFO exampleApertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
question
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
Tutte le issue di STMicroelectronics/STMems_Standard_C_drivers
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Polprzewodnikowy/N64FlashcartMenu#486 · 3 commenti ·
-
crash
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
`core.output` prints string properties without escaping their quotesForse già presa @JensOgorek l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
zauberzeug/lizard#399 ·
I maintainer di solito rispondono entro 2 giorni