-
Notifications
You must be signed in to change notification settings - Fork 3
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
Temperature values from HTS221 sensor for stm32l475 #4
Comments
The minicom output makes it Look like the error happens after it writes the "z", correct? So the error is likely that the Builder is failing to build, and so the unwrap panics. Looks like the Error type implements Debug. Can you see if the error is NACK or OVERRUN? Finally, is this on a custom board, or something like the Nucleo? |
its a discovery kit of stm32l475VGT6 by stm. How I can find out the error type? |
Instead of "unwrap"ing the result of build, you can print the error:
I was developing using a similar board, and I did not have to set the I2C pins to open drain outputs first. Does it behave differently if you do this instead:
|
minicom:
|
If I remove into_open_drain_output calls i get compiler error:
|
Looks like the hprintln didn't do anything useful. Try replacing
That will at least provide a bit more information, but I'm not really sure what to do in either case. You may need to step through the hts221 build function to see which call is failing. That may provide more insight. |
Error:
|
openocd session:
|
I went out and got the same board, and can confirm this issue. I suspect there's something specific to this board that is not enabling either the I2C2 bus or this specific sensor by default, but I haven't had any luck narrowing it down. I doubt the underlying issue is with the driver, but I'll keep the issue open until I can get it fixed, since I'd like to use the sensor on this board. |
I tried out the X-Cube-Watson demo software from STMicro, and it can talk to the HTS221 just fine. Now to replicate all of the initialization in Rust... |
Hi @danielgallagher0 have you managed to find what’s wrong? |
No, I haven't had time in the evenings to work on this for the last couple of months. I should be able to get back to it mid-August or September. |
Hi, any news on this? |
Probably the reason is 10 bit addressing: copterust/vl53l0x#5 |
Finally got back to this, and found it. The issue that @bofh linked is correct, though it's 8-bit addressing, not 10-bit. stm32f30x-hal (which is the first HAL I developed against) uses 7-bit addresses for its I2C devices, and appends the 1-bit R/W value in the least significant place to make the full 8-bit address. stm32l4xx-hal expects the address to be 8-bit. I confirmed by updating the I2C_ID for the HTS221 to 0xBE (i.e., 0x5F << 1), and it works. Will update the crate appropriately and close when released. |
I get runtime error, after this command
block!(tx.write(b'k')).ok();
openocd :
gdb session:
minicom:
The text was updated successfully, but these errors were encountered: