Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run time errors with i2c temperature/humidity sensors #828

Open
pdgilbert opened this issue Dec 27, 2024 · 0 comments
Open

Run time errors with i2c temperature/humidity sensors #828

pdgilbert opened this issue Dec 27, 2024 · 0 comments

Comments

@pdgilbert
Copy link
Contributor

(Possibly related to #749)

I have examples with some embedded-hal v1 temperature/humidity sensor crates that compile but then fail running. The general symptom is that they do not return from an initial call to the hal.

There are three AHT20 sensor crates and also crates for sensors SHT30 and SHTC3. I have checked the sensor crates with a git version and a release version if it exists. The crates are:

I have tested these with stm32f4xx-hal release v0.22.1 and also with a recent git commit #ed88ea13. For comparison I have also tested with @techmccat 's stm32g4xx-hal from https://github.com/techmccat/stm32g4xx-hal#9462f4cd branch hal-1.
All examples compile with both hals (and also with stm32f1xx-hal).
The three AHT20 crates work with stm32g4xx-hal but fail with stm32f4xx-hal. The SHT30 and SHTC3 crates work with stm32f4xx-hal but fail with stm32g4xx-hal.

I have put the examples in a repository https://github.com/pdgilbert/i2c-test. The action tab shows the compiling results. The README has a few more details from GDB.
The repository also includes some examples with @eldruin 's xca9548a-rs multiplexer crate. These also compile but have run time errors (even in the cases where the sensor crates alone work).

Of course, the most likely problem is that I have something wrong in the setup (src/setup_all_stm32f4xx.rs) but I think it is correct (encouraged by the fact that some examples work). Another possibility is that sensor delays are not sufficiently long, but that would likely affect all examples.

Of course, my hope is that the cross-device abstraction can be made to work, so the device crates will work with different HALs. Suggestions would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant