-
Notifications
You must be signed in to change notification settings - Fork 3k
C030 platform I2C initialisation fix #6246
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
Conversation
…s the object to be set up) and zero the I2C object before giving it to i2c_init() as i2_init() has to set up a default frequency for its timeouts to work and it will only do this if the hz field in the object was zero to begin with (otherwise you end up with a random but usually very large indeed timeout).
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.
Thanks for the bug fix!
/morph build |
Build : SUCCESSBuild number : 1330 Triggering tests/morph test |
Test : FAILUREBuild number : 1115 |
Exporter Build : SUCCESSBuild number : 989 |
@RobMeades The failure is not related, have not seen it today but keep watching. I noticed the branch is behind master now (does it include PR #6225?) /morph test |
Lets wait for the test to be finished |
Test : SUCCESSBuild number : 1116 |
Description
In pull request #6117 a better mechanism for the I2C initialisation that is required for all C030 platforms was introduced. However, there was a bug in that mechanism which, depending on an uninitialised stack variable, could result in a failure to boot. This PR fixes that bug.
In
set_minimum_battery_voltage()
change the order of initialisation so thati2c_init()
is called beforei2c_frequency()
asi2c_frequency()
requires a valid I2C object. Zero the I2C object sincei2c_init()
has to set a default frequency for its timeouts to work and it will only do that if thehz
field of the object was zero to begin with.All platform tests pass reliably after this change.
C030_U201_Mbed_Tests_Logs.txt
Pull request type