[Gta04-owner] Battery charging issue

Dr. H. Nikolaus Schaller hns at goldelico.com
Tue Oct 8 11:58:56 CEST 2013


Hi,

Am 08.10.2013 um 11:50 schrieb Adrien Dorsaz:

> Le mardi 08 octobre 2013 à 10:03 +0000, Radek Polak a écrit :
>> Can you try if it charges when you boot from NAND or some older
> versions (e.g. 
>> non upgraded QtMoko v56)?
>> 
> Oh, yeah I've forgotten to precise that it won't charge even with the
> hw-validation debian on NAND (I've not flashed the last one, so it's the
> version of end 2012, normally with the 2.6.32 kernel).
> 
> 
>> For debugging it would be useful to know contents of
>> 
>>        /sys/class/power_supply/bq27000-battery/uevent
>                POWER_SUPPLY_NAME=bq27000-battery
>        POWER_SUPPLY_STATUS=Discharging
>        POWER_SUPPLY_PRESENT=1
>        POWER_SUPPLY_VOLTAGE_NOW=3803000
>        POWER_SUPPLY_CURRENT_NOW=369495
>        POWER_SUPPLY_CAPACITY=60
>        POWER_SUPPLY_CAPACITY_LEVEL=Normal
>        POWER_SUPPLY_TEMP=311
>        POWER_SUPPLY_TIME_TO_EMPTY_NOW=5640
>        POWER_SUPPLY_TIME_TO_EMPTY_AVG=5520
>        POWER_SUPPLY_TECHNOLOGY=Li-ion
>        POWER_SUPPLY_CHARGE_FULL=973182
>        POWER_SUPPLY_CHARGE_NOW=580839
>        POWER_SUPPLY_CHARGE_FULL_DESIGN=1233792
>        POWER_SUPPLY_CYCLE_COUNT=178
>        POWER_SUPPLY_ENERGY_NOW=2147660
>        POWER_SUPPLY_POWER_AVG=359173
>        POWER_SUPPLY_HEALTH=Good
> 
>>       /sys/class/power_supply/twl4030_usb/uevent
>                POWER_SUPPLY_NAME=twl4030_usb
>        POWER_SUPPLY_STATUS=Not charging
>        POWER_SUPPLY_ONLINE=0
> 
>>       /sys/bus/platform/drivers/twl4030_bci/twl4030_bci/max_current
>                499381
> 
>>       /sys/bus/platform/devices/twl4030_usb/vbus
>                off
> 
>> after you plug USB connector in.
>> 
>> You can also try:
>> 
>>        echo Y > /sys/module/twl4030_charger/parameters/allow_usb
> 
> After that I've these values :
> 
>                ---
>        /sys/class/power_supply/bq27000-battery/uevent
>        ---
>        POWER_SUPPLY_NAME=bq27000-battery
>        POWER_SUPPLY_STATUS=Discharging
>        POWER_SUPPLY_PRESENT=1
>        POWER_SUPPLY_VOLTAGE_NOW=3789000
>        POWER_SUPPLY_CURRENT_NOW=362533
>        POWER_SUPPLY_CAPACITY=55
>        POWER_SUPPLY_CAPACITY_LEVEL=Normal
>        POWER_SUPPLY_TEMP=333
>        POWER_SUPPLY_TIME_TO_EMPTY_NOW=5340
>        POWER_SUPPLY_TIME_TO_EMPTY_AVG=5220
>        POWER_SUPPLY_TECHNOLOGY=Li-ion
>        POWER_SUPPLY_CHARGE_FULL=973182
>        POWER_SUPPLY_CHARGE_NOW=536928
>        POWER_SUPPLY_CHARGE_FULL_DESIGN=1233792
>        POWER_SUPPLY_CYCLE_COUNT=178
>        POWER_SUPPLY_ENERGY_NOW=1981220
>        POWER_SUPPLY_POWER_AVG=350577
>        POWER_SUPPLY_HEALTH=Good
>        ---
>        /sys/class/power_supply/twl4030_usb/uevent
>        ---
>        POWER_SUPPLY_NAME=twl4030_usb
>        POWER_SUPPLY_STATUS=Not charging
>        POWER_SUPPLY_ONLINE=0
>        ---
>        /sys/bus/platform/drivers/twl4030_bci/twl4030_bci/max_current
>        ---
>        499381
>        ---
>        /sys/bus/platform/devices/twl4030_usb/vbus
>        ---
>        off
>        ---
>        /sys/module/twl4030_charger/parameters/allow_usb
>        ---
>        Y
> 
> So it doesn't make any difference. I don't think it's a QtMoko bug,
> because last week it worked well before the SHR test and it doesn't work
> with the hw-validation debian on NAND. I don't understand really well
> what's the problem.
> 
> For information, below, the same values when I'm able to charge my phone
> with the external battery and the good usb cable after having plugged
> during resume of a suspend (with screen locked) :
> 
>                ---
>        /sys/class/power_supply/bq27000-battery/uevent
>        ---
>        POWER_SUPPLY_NAME=bq27000-battery
>        POWER_SUPPLY_STATUS=Charging
>        POWER_SUPPLY_PRESENT=1
>        POWER_SUPPLY_VOLTAGE_NOW=3879000
>        POWER_SUPPLY_CURRENT_NOW=-179214
>        POWER_SUPPLY_CAPACITY=54
>        POWER_SUPPLY_CAPACITY_LEVEL=Normal
>        POWER_SUPPLY_TEMP=336
>        POWER_SUPPLY_TIME_TO_FULL_NOW=11160
>        POWER_SUPPLY_TECHNOLOGY=Li-ion
>        POWER_SUPPLY_CHARGE_FULL=973182
>        POWER_SUPPLY_CHARGE_NOW=528003
>        POWER_SUPPLY_CHARGE_FULL_DESIGN=1233792
>        POWER_SUPPLY_CYCLE_COUNT=178
>        POWER_SUPPLY_ENERGY_NOW=1772440
>        POWER_SUPPLY_POWER_AVG=0
>        POWER_SUPPLY_HEALTH=Good
>        ---
>        /sys/class/power_supply/twl4030_usb/uevent
>        ---
>        POWER_SUPPLY_NAME=twl4030_usb
>        POWER_SUPPLY_STATUS=Charging
>        POWER_SUPPLY_ONLINE=1
>        POWER_SUPPLY_VOLTAGE_NOW=4885902
>        POWER_SUPPLY_CURRENT_NOW=605736
>        ---
>        /sys/bus/platform/drivers/twl4030_bci/twl4030_bci/max_current
>        ---
>        599089
>        ---
>        /sys/bus/platform/devices/twl4030_usb/vbus
>        ---
>        on
>        ---
>        /sys/module/twl4030_charger/parameters/allow_usb
>        ---
>        Y


The battery looks good and since you can charge with your external charger it must be something else.

Can you run the charger-script:

http://git.goldelico.com/?p=gta04-rootfs.git;a=blob;f=debian/config/root/charger;h=67f7355a237e69734e9a2c109c1511c7e8e1685f;hb=HEAD

or at least:

VOLT=$(cat /sys/devices/platform/twl4030_madc_hwmon/in12_input)
echo volt: ${VOLT}mV ca. $(expr \( "$VOLT" - 3300 \) \* 100 / 950)%
echo current: $(cat /sys/devices/platform/twl4030_madc_hwmon/curr10_input)mA
echo temp: $(cat /sys/devices/platform/twl4030_madc_hwmon/temp1_input)°C
echo type: $(cat /sys/devices/platform/twl4030_madc_hwmon/in0_input)mV
echo ADC7: $(cat /sys/devices/platform/twl4030_madc_hwmon/in7_input)mV  # MICSENSE
echo VBUS: $(cat /sys/devices/platform/twl4030_madc_hwmon/in8_input)mV
echo VCHG: $(cat /sys/devices/platform/twl4030_madc_hwmon/in11_input)mV

It should also print the VBUS measured directly.

Or even trace (may not run on 2.6.32 kernel)

http://git.goldelico.com/?p=gta04-rootfs.git;a=blob;f=debian/config/root/batt;h=07cc6aad1ba330e8ea67484970c8197a5b68a644;hb=HEAD

run with ./batt 1 and watch how values change when plugging/unplugging the charger(s).

BR,
Nikolaus



More information about the Gta04-owner mailing list