This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ27441-G1: bq27441-G1A behavior

Part Number: BQ27441-G1
Other Parts Discussed in Thread: AM3354, BQSTUDIO,

For reference this is in a linux system, based on AM3354 platform.

When watching the status of our fuel gauge (bq27441) through the command watch -n 1 cat /sys/class/power_supply/bq27441-0/uevent we occasionally see the POWER_SUPPLY_PRESENT value change from 1 to 0. The power supply does not go away or disconnect from the board.  After this occurs the only other printed value is POWER_SUPPLY_NAME. During the tests that result in this state, the board is not interacted with and we have no other application accessing the data. The test is essentially letting the board boot to console, sending the watch command and walking away. We have found no consistent period with which this issue occurs. Rebooting the board through the command line reboot does not fix this issue. The only way to fix this state is to fully power cycle the board. Do you have any suggestions on why this is occurring and how we can remedy it?

Normal output:
POWER_SUPPLY_NAME=bq27441-0
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_VOLTAGE_NOW=4152000
POWER_SUPPLY_CURRENT_NOW=0
POWER_SUPPLY_CAPACITY=100
POWER_SUPPLY_CAPACITY_LEVEL=Normal
POWER_SUPPLY_TEMP=286
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CHARGE_FULL=1214000
POWER_SUPPLY_CHARGE_NOW=1251000
POWER_SUPPLY_CHARGE_FULL_DESIGN=1340000
POWER_SUPPLY_MANUFACTURER=Texas Instruments

Issue Output:
POWER_SUPPLY_NAME=bq27441-0
POWER_SUPPLY_PRESENT=0

  • Hi Matt,

    You would need to look at how the driver is determining if the power supply is present. 

    Best regards,

  • The driver is supplied by TI in the SDK.

    The hardware responds to "i2cdetect -y 0" command after this state is reached so I believe the IC to be OK.

  • Hi Matt,

    Can you provide logs shows the behavior and your .gg file.

    Thanks,

  • Nick,

    Whats a .gg file?

    Here is a serial output from the event happening.

    Every 1s: cat /sys/class/power_supply/bq27441-0/uevent                                                             2020-12-17 02:03:02

    POWER_SUPPLY_NAME=bq27441-0
    POWER_SUPPLY_STATUS=Charging
    POWER_SUPPLY_PRESENT=1
    POWER_SUPPLY_VOLTAGE_NOW=4162000
    POWER_SUPPLY_CURRENT_NOW=388000
    POWER_SUPPLY_CAPACITY=95
    POWER_SUPPLY_CAPACITY_LEVEL=Normal
    POWER_SUPPLY_TEMP=324
    POWER_SUPPLY_TECHNOLOGY=Li-ion
    POWER_SUPPLY_CHARGE_FULL=1215000
    POWER_SUPPLY_CHARGE_NOW=1183000
    POWER_SUPPLY_CHARGE_FULL_DESIGN=1340000
    POWER_SUPPLY_MANUFACTURER=Texas Instruments
    Every 1s: cat /sys/class/power_supply/bq27441-0/uevent                                                             2020-12-17 02:03:04

    POWER_SUPPLY_NAME=bq27441-0
    POWER_SUPPLY_STATUS=Charging
    POWER_SUPPLY_PRESENT=1
    POWER_SUPPLY_VOLTAGE_NOW=4161000
    POWER_SUPPLY_CURRENT_NOW=383000
    POWER_SUPPLY_CAPACITY=95
    POWER_SUPPLY_CAPACITY_LEVEL=Normal
    POWER_SUPPLY_TEMP=324
    POWER_SUPPLY_TECHNOLOGY=Li-ion
    POWER_SUPPLY_CHARGE_FULL=1215000
    POWER_SUPPLY_CHARGE_NOW=1183000
    POWER_SUPPLY_CHARGE_FULL_DESIGN=1340000
    POWER_SUPPLY_MANUFACTURER=Texas Instruments
    Every 1s: cat /sys/class/power_supply/bq27441-0/uevent                                                             2020-12-17 02:03:05

    POWER_SUPPLY_NAME=bq27441-0
    POWER_SUPPLY_STATUS=Charging
    POWER_SUPPLY_PRESENT=1
    POWER_SUPPLY_VOLTAGE_NOW=4162000
    POWER_SUPPLY_CURRENT_NOW=388000
    POWER_SUPPLY_CAPACITY=95
    POWER_SUPPLY_CAPACITY_LEVEL=Normal
    POWER_SUPPLY_TEMP=324
    POWER_SUPPLY_TECHNOLOGY=Li-ion
    POWER_SUPPLY_CHARGE_FULL=1215000
    POWER_SUPPLY_CHARGE_NOW=1183000
    POWER_SUPPLY_CHARGE_FULL_DESIGN=1340000
    POWER_SUPPLY_MANUFACTURER=Texas Instruments
    Every 1s: cat /sys/class/power_supply/bq27441-0/uevent                                                             2020-12-17 02:03:06

    POWER_SUPPLY_NAME=bq27441-0
    POWER_SUPPLY_PRESENT=0
    Every 1s: cat /sys/class/power_supply/bq27441-0/uevent                                                             2020-12-17 02:03:07

    POWER_SUPPLY_NAME=bq27441-0
    POWER_SUPPLY_PRESENT=0
    Every 1s: cat /sys/class/power_supply/bq27441-0/uevent                                                             2020-12-17 02:03:08

    POWER_SUPPLY_NAME=bq27441-0
    POWER_SUPPLY_PRESENT=0
    Every 1s: cat /sys/class/power_supply/bq27441-0/uevent                                                             2020-12-17 02:03:09

    POWER_SUPPLY_NAME=bq27441-0
    POWER_SUPPLY_PRESENT=0
    Every 1s: cat /sys/class/power_supply/bq27441-0/uevent                                                             2020-12-17 02:03:10

    POWER_SUPPLY_NAME=bq27441-0
    POWER_SUPPLY_PRESENT=0
    Every 1s: cat /sys/class/power_supply/bq27441-0/uevent                                                             2020-12-17 02:03:11

    POWER_SUPPLY_NAME=bq27441-0
    POWER_SUPPLY_PRESENT=0

  • Hi Ryan,

    The .gg is the gauge configuration file which can be extracted from data memory tab in bqstudio.

    More importantly you can also generate a log from bqstudio which we will need to debug this issue. This will tell us what the gauge is doing. 

    Best regards,

  • Nick,

    Sorry I thought you were looking for a linux file.  It was my understanding that BQ27441DRZR-G1A doesn't use a .gg file.

    Thanks,

  • Hi Matt,

    It appears the driver was not written by TI: 

    You may want to contact the authors.

  • Hi Nick,

    Do you have a driver that TI recommends and will support? 

    This driver is clearly recommended by TI. This is the direct link from the BQ27441-G1A webpage under software development.  https://www.ti.com/tool/BQ27XXXSW-LINUX

    Thanks,

    Matt

  • Hi Matt,

    The gauge does use a .gg

    Please upload the .gg and logs showing the issues.

    Thank you,

  • Nick,

    I don't not have a .gg file.  Again, It was my understanding that you just had to give it the basic information on the cell like max capacity. Then it has a profile for the chemistry and maximum charge voltage, that is why we are using the G1A variant and not G1B.  Any information how the BQ27441-G1A uses the .gg file would be helpful here to clear up my misunderstanding.

    What is the process of creating a .gg file?

  • Hello Matt,

    Do you have successful I2C communication with the BQ27441-G1 after you get POWER_SUPPLY_PRESENT=0?

  • Hi Shirish,

    It responds to "i2cdetect -y 0" command from the console.  So my assumption is yes.

  • Hello Matt,

    Thanks. That means that the bq27441-G1 is functioning correctly. Assuming that there is no issue with the gauge itself, the next step is to trace the code.

    bq27xxx_battery.c makes a call into the ACPI system to get POWER_SUPPLY_PRESENT

    Relevant snippets from bq27xxx_battery.c are reproduced below

    struct bq27xxx_device_info *di = power_supply_get_drvdata(psy);

    if (psp != POWER_SUPPLY_PROP_PRESENT && di->cache.flags < 0)
            return -ENODEV;

    case POWER_SUPPLY_PROP_PRESENT:
            val->intval = di->cache.flags < 0 ? 0 : 1;
            break;

    I would suggest putting debug code in bq27xxx_battery.c and inside power_supply_get_drvdata() to get to root cause.

     

    Here is the battery present function call in battery.c for further reference

    if (acpi_battery_present(battery)) { /* run battery update only if it is present */ acpi_battery_get_state(battery); } else if (psp != POWER_SUPPLY_PROP_PRESENT) return -ENODEV;

  • Hi Nick,

    Any info you could share on how the G1A uses a .gg file would be helpful.

    Thanks,

  • Hello Matt,

    The G1A .gg file contains configuration data that can be written to the gauge (NVM or OTP).

    This post may be helpful regarding information on NVM vs OTP

  • I believe this is related to EMI/ESD events close to the device.  Adding a 100pf cap to VDD appears to resolve this issue.