-
Notifications
You must be signed in to change notification settings - Fork 31
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
Possible external I2C bus issue #210
Comments
Hello @goran-mahovlic , Thanks for opening the issue. First: I think it is good to mention in the description that this issue is related to the external sensor bus I2C2, and your own personal integration with an external AS7341 sensor. Second:
Since you are mentioning that:
It feels like this is an integration issue with the external sensor. We will do our best to try to reproduce it, but I would appreciate it if you can provide us with more description on the error and the time it takes the sensor to start responding again after an error. |
Summary:
While using library for AS7341 sensor I have noticed that I2C HAL sometimes fails and returns HALL ERROR. That is problematic as at that point I cannot send commands to sensor and this sensor needs to be set into sleep mode via commands. If I do not check HAL fail I end up with higher consumption in sleep mode. And after some time, and wake HAL starts to work - so it is not noticeable by sensor readings. It happens maybe once every 100 wakes, so it is not easy to catch.
After adding small delay before HAL_I2C_Mem_Write I get this error really rare
https://github.com/goran-mahovlic/generic-node-se/blob/develop/Software/lib/AS7341/AS7341.c#L38
I still did not find why this is happening so I just implemented check for HAL error and if it happens before sensor ends in sleep mode I just do system reset. That way I will know it is still happening, and I am not in risk of high consumption on the device.
...
Steps to Reproduce:
I did not try, but maybe looping HAL_I2C_Mem_Write some external sensor would bring same results.
What do you see now?
...
What do you want to see instead?
...
How do you propose to implement this?
...
Environment:
...
What can you do yourself and what do you need help with?
...
The text was updated successfully, but these errors were encountered: