Skip to content

C030 Battery Charger Voltage Fix #5677

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 3 commits into from
Dec 20, 2017

Conversation

bqam-ublox
Copy link
Contributor

Description

This is a fix for on board BQ24295 battery charger on UBLOX C030 application board. This allows longer USB cables or USB ports with lower output voltages to power the board correctly. An I2C interface is used to set the battery voltage in boot sequence.

Status

READY

  • Tested on UBLOX_C030 application boards using the battery charger driver
  • New files introduced in vendor specific TARGET_UBLOX_C030 folder

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 8, 2017

@bqam-ublox Is there any reason to have this in C++, all what it does is read/write i2c seq, during boot up sequence

Add license headers to files please

@RobMeades
Copy link
Contributor

Looks good to me, thanks @bqam-ublox.

@bqam-ublox
Copy link
Contributor Author

@0xc0170 I have tried to do this in C by using the i2c_api but it does not work properly. It gets stuck in timeout that is dependent on the frequency parameter which is being set in the constructor. Also tried to use other functions from i2c_api but to no avail. At most, if it does not get stuck, it is still unsuccessful and the value is not written after the i2c write function.

@bqam-ublox
Copy link
Contributor Author

@0xc0170 Licenses added in header files

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small code style there

HAL_MspInit is functional (that there is only one strong symbol) ? we provide mbed_sdk_init that is for this purpose.


#include "battery_charger_i2c.h"

BatteryChargerI2c::BatteryChargerI2c(PinName sda, PinName scl):_i2c(), _hz(100000) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ on the new line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xc0170 C030 is based on STM32F4 so mbed_sdk_init is already defined as a strong function in mbed_overrides.c located in TARGET_STM. The HAL_MspInit function is called from within mbed_sdk_init and is meant to be used in user file as per stm32f4xx_hal.c The following comment is extracted from stm32f4xx_hal.c referring to HAL_MspInit:
/* NOTE : This function Should not be modified, when the callback is needed,
the HAL_MspInit could be implemented in the user file
*/

Change in the coding style noted.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do that change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies...change commited

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 13, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Dec 13, 2017

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Dec 13, 2017

@mbed-ci
Copy link

mbed-ci commented Dec 13, 2017

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 15, 2017

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Dec 15, 2017

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