Skip to content

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

Merged
merged 1 commit into from
Mar 5, 2018
Merged

Conversation

RobMeades
Copy link
Contributor

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 that i2c_init() is called before i2c_frequency() as i2c_frequency() requires a valid I2C object. Zero the I2C object since i2c_init() has to set a default frequency for its timeouts to work and it will only do that if the hz 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

  • Fix
  • Refactor
  • New target
  • Feature
  • Breaking change

…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).
Copy link
Contributor

@cmonr cmonr left a 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!

@cmonr cmonr added the needs: CI label Mar 1, 2018
@cmonr
Copy link
Contributor

cmonr commented Mar 1, 2018

@RobMeades @bqam-ublox Fyi

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 5, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Mar 5, 2018

Build : SUCCESS

Build number : 1330
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6246/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Mar 5, 2018

@mbed-ci
Copy link

mbed-ci commented Mar 5, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 5, 2018

@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

@RobMeades
Copy link
Contributor Author

@0xc0170: yes, the branch does have #6225. There's been a huge jump in history mainly because of the un-squashed new cellular landing but I could re-base anyway, if you'd prefer?

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 5, 2018

Lets wait for the test to be finished

@mbed-ci
Copy link

mbed-ci commented Mar 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants