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

Validate I2C register read #1

Open
neilh10 opened this issue Nov 12, 2021 · 4 comments
Open

Validate I2C register read #1

neilh10 opened this issue Nov 12, 2021 · 4 comments

Comments

@neilh10
Copy link
Owner

neilh10 commented Nov 12, 2021

In some cases when reading from the STC3100 registers, they are read as 0xff.
When reading from the STC3100, need to validate that the transaction is good.
This is a general I2C issue that there is no way of validating the read registers.

It may be possible to parse the message looking for out of expected range values, and if received redo the transaction.

@neilh10
Copy link
Owner Author

neilh10 commented Feb 3, 2022

The bad reads can happen after an I2C lockup.
It would seem that if there is a bad read, it should be caught in the physical device driver ST3100dd.

Arduino I2C lockup has had a lot of discussion. arduino/Arduino#1476
Enabling it is here 54891f1

@haydenth
Copy link

Hey @fronders is this something we can help fix / have already fixed?

@fronders
Copy link
Contributor

Well, in STM32 I2C there's no such problem at all, since the HAL library allows to validate the I2C transactions. Basically same check that we implemented for timeout works out for this purpose too, two birds with one stone 😁. In AVR Wire though there's no such possibility, and added timeout check should address the issue. Another way of solving this for AVR is to move to alternative Wire implementations that provide such validation check

@neilh10
Copy link
Owner Author

neilh10 commented Aug 11, 2023

Thanks for the thoughts.
@fronders , interesting your mentioning of the AVR Wire timeout, doesn't that perform the same function. ?
I must confess I have watched some of the Arduino conversations, but I haven't got out my I2C Protocol analyzer to understand what is happening with the STC3100. I have found some chips are more susceptible to repeated read problems than other chips ~ so I was able to filter out for a few chips that I used, and then gave up on the chip and coloumb counter philosophy. Plus the chips became unavailable.

I've been using a few left over boards with the STC3100 for some test bench power usage monitoring and accurately monitoring a LiIon battery over power discharge, and that doesn't require reliability, but always interested to understand the root causes. Especially with the new I3C protocols coming along

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

3 participants