-
Notifications
You must be signed in to change notification settings - Fork 511
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
[Gen 3] Fix micros/millis/unixtime becoming non-monotonic / Make I2C bus reset less destructive if performed in the middle of the transaction #2303
Conversation
…ot before talking to AM1805 and BQ24195
uint16_t config = buf[0] << 8 | buf[1]; | ||
assertEqual(config, MAX17043_DEFAULT_CONFIG); | ||
|
||
// Validate that we can read exactly the same configuration with soft i2c implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you help me understand why we need to use software I2C to validate the communication with the fuel gauge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use software I2C to create a situation of an interrupted transaction at a particular location e.g. clock 3 bits out 8 or clock 1 byte and 5 bits and then check whether hal_i2c_reset
can reliably terminate this ongoing transaction without writing garbage data into the slave (previously it would have just clocked 9 high bits).
Problem
DWT->CYCCNT
See also https://github.com/particle-iot/device-os/issues/2291
Solution
DWT->CYCCNT
, so that the micros/millis/etc counters stay monotonic.OUTPUT_OPEN_DRAIN_PULLUP
pin mode.Steps to Test
wiring/no_fixture
:I2C_07_bus_reset_is_not_destructive
wiring/timer_stress
(requires temperature controlled environment, see README.md)Example App
N/A
References
Completeness