[Letux-kernel] Pyra charging
H. Nikolaus Schaller
hns at goldelico.com
Thu Nov 12 17:10:31 CET 2020
> Am 12.11.2020 um 16:37 schrieb Michael Mrozek <EvilDragon at openpandora.org>:
>
> Am Donnerstag, den 12.11.2020, 11:50 +0100 schrieb H. Nikolaus
> Schaller:
>
>
> Hi,
>
> Dave also mentioned something about the Watchdog in IRC,
I think he meant the Palmas WDT. There are 3 different ones!
bq24297, palmas, omap5.
bq24297-wdt: for resetting the bq to default charging if OMAP is off or panics
palmas-wdt: could turn of OMAP power if OMAP panics
omap5-wdt: generates an interrupt and warning and may kernel panic
> AFAIR, seems
> like there's still a lot we can do regarding the driver software.
Yes.
>
> I also did test a bit more - and found out the following:
>
> * If I charge the unit (while idling) via the Serial port, it draws
> about 1.8A (at 5.3V) from my power supply, which seems to work fine.
>
> * If I charge the unit via the USB OTG port, it draws about 2.5A, so it
> seems using this port, the battery can be charged faster. However, when
> I do this, the battery shows an error after a while. I put the battery
> out and measured the temperature using an external measurement device -
> and it was around 39°C. So yeah, that's probably the reason here it
> disconnects!
>
> It seems with 2.5A, the battery runs too hot, where it works still fine
> with 1.8A.
Sure, less charging current means less heat to dissipate. Basically the
battery is a capacitor and a resistor. The resistor generates heat according
to P = I^2 / R. So doubling the current means four times heat.
> It could be that 45°C would be good enough (if we change the
> resistors), but a quick question upfront:
>
> Can we limit the input current?
Yes. You can always do
echo 2000000 >/sys/class/power_supply/bq24297/input_current_limit
(or similar, I do not remember the exact path).
BTW: on my rootfs setups it is limited to 2A so I should not be able to
measure 2.5A.
>
> So, for example, if we had some thermal management that watches the
> temperature: If the battery reaches 32°C, limit the current to 2A max
> to prevent the battery from heating even more?
Yes, that is a good idea. It would extend charging time but is a
control knob to turn...
>
> Is that limit software configurable - or does the bq not support this?
Yes it does. Not continuously but AFAIR there are ca. 8 levels.
>
>> I have a new observation. While testing the new mipi display driver
>> the battery drained completely and the Pyra was shut down (by
>> Palmas).
>>
>> Then I connected the charger to the USB port. Charging (and the Pyra)
>> started for a short time (LED goes red).
>>
>> After a while the Pyra went off again, even with USB cable connected.
>> And the red LED turned off. At ca. 30°C. So no over/under
>> temperature.
>>
>> Now the interesting observation: even unplugging and replugging
>> the USB cable did not (re)start charging to let the LED go red.
>>
>> What I had to do was to unplug USB and remove the battery. After
>> that,
>> the Pyra was constantly charging for ca. 4-5 hours until the battery
>> became full. Even while I turned on/off/reboot the Pyra while
>> continuing
>> my tests.
>>
>> Now the new idea: does this have something to do with the "safety
>> timer?". Should we restart it to trigger a new charging sequence?
>> Does it stop every further charging attempt once expired?
>>
>> I am not even sure if the safety timer can be reset by software.
>>
>> If not, we may have to use the bq2429x watchdog which resets the
>> chip (like unplugging the battery) if the OMAP isn't retriggering
>> it every now and then. This would also have the benefit that the
>> chip falls in a well defined state if we turn the OMAP off which
>> does not depend on what the bq driver did in the past minutes.
>>
>> I have some (untested/incomplete/experimental) bq2429x watchdog
>> extension which I have attached.
>>
>> Discussion of this topic is welcome.
>>
>> BR,
>> Nikolaus
>>
>> _______________________________________________
>> Kernel mailing list
>> Kernel at pyra-handheld.com
>> http://pyra-handheld.com/cgi-bin/mailman/listinfo/kernel
>
> --
> Mit freundlichen Grüßen,
>
> Michael Mrozek
>
> -----------------------
> OpenPandora GmbH
> Geschäftsführer: Michael Mrozek
>
> Schäffbräustr. 11
> 85049 Ingolstadt
> Deutschland
> Tel.: 0841 / 990 5548
> http://www.openpandora.de/
> HRB 4879, Amtsgericht Ingolstadt
> -----------------------
> eMail: mrozek at openpandora.org
More information about the Letux-kernel
mailing list