-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
@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 |
Looks good to me, thanks @bqam-ublox. |
@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. |
@0xc0170 Licenses added in header files |
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.
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) { |
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.
{
on the new line
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.
@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.
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.
Can you do that change?
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.
Apologies...change commited
/morph build |
Build : SUCCESSBuild number : 691 Triggering tests/morph test |
Test : SUCCESSBuild number : 522 |
Exporter Build : ABORTEDBuild number : 333 |
/morph export-build |
Exporter Build : SUCCESSBuild number : 358 |
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