[Gta04-owner] bq27000-battery: battery is not calibrated! ignoring capacity values

EdorFaus edorfaus at xepher.net
Tue Feb 5 00:00:30 CET 2013


On 02/04/2013 07:06 AM, NeilBrown wrote:
> On Sun, 03 Feb 2013 22:47:03 +0100 EdorFaus <edorfaus at xepher.net> wrote:
>> The problem is that, since we haven't seen the datasheet or any other
>> relevant information, we don't actually know what that calibration
>> procedure is supposed to be.
>
> Datasheets can be found.  e.g.
> http://www.ti.com/lit/ds/symlink/bq27200.pdf

Ah, thank you! I'm apparently no good at that.

If I read this correctly, the calibration is specified to happen 
automatically whenever the battery goes from a full charge to completely 
empty in one go, which is basically what I thought.
Nice to see that confirmed by official documentation.

(Sheet also says that no calibration is needed, but by that it appears 
to mean that no *manual* calibration (as in, measuring and configuring) 
is needed, either by the end-user or the device/battery builder.)


> There are two things that can cause this message.
>
> The first is if the BQ27000 in your battery doesn't think that it is
> calibrated.  This seems unlikely except for a new battery or one that has
> been left to go completely flat for a long time.  Normally the BQ27000 will
> think it is calibrated, even if the calibration is inaccurate.

Well, a new battery is precisely what I had, and others will also 
probably get new batteries as their old ones die (or if they're buying 
their first device).

Leaving a Li-Ion battery completely flat for any significant length of 
time is (AFAIK) likely to kill it (or at least be very detrimental to 
its health), so I guess that might be less of a concern, really.


> The second is if the BQ27000 doesn't respond to a read properly.  In that
> case an attempt to read the 'flags' will see 0xFF, and as that has the
> "Capacity Inaccurate" flag set, the driver will think that it is not
> calibrated.  This happens for example if you take the battery out.

Hm, the sheet says the CI flag will also be set if the battery has been 
through 32 cycles since the last calibration.

It also says (unless I'm misreading it) that the chip will then use the 
design values to calculate the values we read - which suggests that 
Radek shouldn't need to, since the chip already does it... But I guess 
the driver might be blocking that somehow? Or maybe the battery 
indicator is relying on some values the chip doesn't provide in that case?


> This also happens if you have a battery without a BQ27000 in it, hence
> Nikolaus' earlier question "HDQ can't detect battery presence?"
>
> While the one-wire bus can enumerate devices, the HDQ bus (which is
> similar but simpler) cannot.  So if the device doesn't expect to have a
> BQ27000 in the battery, we need to tell the kernel.
>
> Possibly we could get the BQ27000 driver to detect read errors better and
> somehow report "no battery" rather than "not calibrated".

Maybe there's a readable register somewhere that will always contain at 
least one 0 bit? Then a 0xFF read could trigger a read from that 
register to see if we're actually talking to a battery or not, and if 
so, perhaps retry the original read to see if it's still 0xFF.

I don't know if this is actually feasible though, not having checked the 
details.


>> So, I have a question: is it possible to temporarily disable the
>> function that stops charging when the battery is full, so that it keeps
>> charging as long as the device is plugged in?
>
> No it isn't.  That is a function of the hardware.  The charger will keep
> charging until the current drops below a certain value, and then stops
> charging.

Ah, OK, I see. That's perfectly reasonable, and seems much more 
dependent on actual battery capacity than on any software readings 
thereof, which suggests that I shouldn't bother trying even if I could.

Regards,
Frode Austvik


More information about the Gta04-owner mailing list