User:DanielDrake/XO Troubleshooting Battery

From OLPC
Jump to navigation Jump to search
  This page is monitored by the OLPC team.
  Please copy/paste "{{Translationlist | xx | origlang=en | translated={{{translated}}}}}" (where xx is ISO 639 language code for your translation) to User:DanielDrake/XO Troubleshooting Battery/translations HowTo [ID# 270760]  +/-  


Introduction

This is the portion of the XO Troubleshooting Guide for diagnosing problems with the battery on an XO laptop. The Help activity and XO manual for release 8.2.0 also has a "Battery charging" chapter [1].

This page details only problems that actually reside within the battery. Note that if you are having problems running an XO from battery power, or having problems charging a battery, such problems could be the fault of the laptop (the battery itself may be fine). Problems that are localised to the laptop itself are discussed at XO Troubleshooting Power.

How can you tell whether a particular problem is due to a faulty battery or faulty laptop? This is easiest when you have two XOs. Let's say you have laptop A including battery A, which is exhibiting a problem. You also have laptop B with laptop B, which is your personal XO which you trust to be functioning well. Take battery A and place it in laptop B, and take battery B and put it in laptop A. Testing both laptops will then give you a strong indication as to where the problem resides. Does the problem "follow" battery A into laptop B? If so, the problem resides within the battery (you're on the right page). Or does the problem remain within laptop A even when running from battery B? In such case, the problem resides within the laptop (see XO Troubleshooting Power).

If you only have one XO available to you, it is suggested that you have a quick read of both this page and XO Troubleshooting Power. You should be able to make an educated guess as to which page is the most appropriate for your problem. If in doubt, follow the diagnostics outlined on both pages.

Start here

First, take a quick look at the battery, especially the black connector which contains the contacts that electrically connect the battery to the laptop. Dried green crystals have been spotted around the connector on non-functional batteries on some occasions. This is from decomposition of the contact metal due to electrolysis in water. This may be cleaned with baking soda mixed with water, using a toothbrush. Wash your hands well afterwards. This may recover the battery, unless the contacts have become badly corroded.

Perform an XO Full Reset. If you know the problem is localised within a battery, this is unlikely to make any difference. Nevertheless, lets do it now to be sure.

Disconnect the battery, and connect the laptop to AC power. Now turn on the laptop. After the system has loaded, insert the battery.

Does the battery LED start flashing red? If so, jump to #Battery LED is flashing red.

Does the battery LED start flashing yellow? If so, see #Battery LED is flashing yellow.

For more information on the battery LED, see [2].

Is there no apparent response in the battery LED? See #Battery detection diagnostics

Now fully charge the battery, and wait for the battery LED to go green. Now disconnect AC power and discharge the battery while the system is running, keeping an eye on the percentage charge.

Does the system shut down abruptly with over 10% of charge remaining? If so, see #Laptop shuts down abruptly with significant charge remaining.

Now, starting with the battery completely discharged, perform a #Capacity test of the battery.

Is the battery capacity significantly lower than that of the rated specification? If so, see #Battery capacity is significantly degraded.

Battery LED is flashing red

Lets start with the case that has the most solid diagnosis available: you have the laptop running with the battery inserted, and the laptop is also connected to AC power. The laptop seems to run fine with AC power connected, but the battery LED is flashing red (to be clear: the battery LED briefly is illuminated briefly as red, and then turns off, and this cycle repeats), and the laptop may not be able to be run from battery power alone.

This flashing-red pattern means that the Embedded Controller (EC) has detected a problem with the battery. To understand this further, we can ask the EC for the error code. From the Ok prompt:

ok ec-abnormal@ .

Note the '.' at the end. An error code will be returned.

Now run:

ok watch-battery

And hit escape. An error message will be printed. This message is a human-readable interpretation of the error code.

Now identify the section below that corresponds to the error code/error message and follow the instructions for potential solutions.

Wrong Pack setting (code 02)

Under certain conditions some settings in the battery EEPROM can get corrupted. This error indicates this has happened. It may or may not be permanent. Using batman and bat-dump-banks the contents of the EEPROM can be examined. This is a different condition than what bat-check-and-recover looks for. Please do not use bat-check-and-recover to try and fix this. Contact OLPC techsupport or the developers list for help.

LiFePo4 Overtemp (code 0b)

The battery got too hot. Turn off the system remove the battery and let things cool.

Bank 1 Invalid

This message can be produced when the memory in the gas gauge has become corrupted, causing the battery identification data to be lost. This fix should only be attempted on batteries that are labelled as Made by BYD Company Limited on the label printed on the internal-facing side of the battery.

This problem can be fixed with batman. Load batman, according to the instructions on this page, then attempt to fix the problem with:

ok batman-start
ok bat-set-life-byd
ok batman-stop

Now remove and insert the battery.

Note that these same set of symptoms can also be indicative of other non-ID problems, so this may not solve your problem. If the problem remains after attempting this fix, you will need to examine the battery banks and contact OLPC tech support.

Bank 0 Invalid

First, using a serial console, save the output from the batman command:

ok bat-dump-banks

This may be useful later. Plus, OLPC would appreciate seeing this information posted to the devel mailing list in cases where the repair worked.

There could be many causes of this error. One case found in Nicaragua had all bytes in bank 0 shifted left by one byte. The EC was then confused when reading a strange value from the status byte.

This was successfully solved with:

ok bat-fix-error-2

It should be safe to try this repair technique for any case of Bank 0 Invalid, but it may not be able to solve the particular problem you are seeing. After running the command, perform a full reset (disconnect AC power, remove and reinsert battery).

If that didn't fix your problem, you can try a more invasive Bank 0 reset. This is only valid for XO-1 and XO-1.5 batteries at this time, don't try it on a battery that originally arrived in a XO-1.75 laptop.

ok bat-reset-bank0

After running the command, perform a full reset (disconnect AC power, remove and reinsert battery). If the error condition cleared, the system will now be confused regarding the percentage of battery power remaining - you need to complete a full charge or a full discharge before things regain synchronization.

Battery LED is flashing yellow

This indicates the battery is being trickle charged. This is normal but only occurs for a very low battery. Leave the XO plugged in and normal charging will resume after trickle has finished. It may take up to an hour before normal charging commences.

Trickle charging occurs when the battery voltage is lower than 5.4V. This can be monitored with the watch-battery firmware command detailed below.

If trickle charging persists after an extended period of time, go to the #OK prompt and run:

ok watch-battery

If watch-battery reports 0V 0A 0C and trickle charge, it may be worth testing the battery with a multimeter. See the #Multimeter test.

Battery detection diagnostics

If the system provides no apparent response in the battery LED when a battery is inserted, here are some diagnosis steps.

Power off the laptop, remove the battery, power on the laptop again and go to the #OK prompt. Now run:

ok watch-battery

Is a battery reported? If so, your problem is not related to battery detection, and must be related to battery charging or usage, discussed elsewhere on this page.

Power off the laptop, remove the battery, power on the laptop again and go to the #OK prompt. Now run:

ok see-bstate

This command continually prints the EC 1-wire communication state machine index. In other words, it's a low-level dump of the EC's communication with the battery. Before the battery is inserted, you will see a repeated pattern (usually "0 1 2" or "0 1 3").

With see-bstate still runing, insert the battery and examine any change in the output. If there is no change in the output, it means the battery did not respond, see the "incorrect speed setting" section below.

If there is some change in the output, it means that the system did detect some form of battery presence, but this would be an unexpected case.

Incorrect speed setting in battery EEPROM

If there is no change in see-bstate output when inserting a battery, you are possibly seeing a problem of incorrect speed setting in battery EEPROM.

The gauge chip in the battery can support two different 1-wire speed modes, selected by a setting in the EEPROM. OpenFirmware only offers support for the low-speed mode, which is configured by default in our batteries.

If the battery EEPROM becomes corrupted in such a way that the speed setting is switched to high-speed, the system will fail to see the battery. watch-battery and see-bstate will behave as if no battery has been inserted.

This can be corrected with one-wire interface equipment, which is readily available and quite cheap. Some OLPC deployments have obtained such equipment and use it to correct problems such as these. Such devices are able to reprogram the battery EEPROM, removing the corruption and going back to low-speed mode. If purchasing such equipment, be sure to buy a device that supports high-speed more - not all do.

Firmware versions Q2F01 and newer for XO-1, and all firmware versions for XO-1.5 and XO-1.75 try very hard to avoid this condition, by detecting it before the EEPROM is written and enforcing low-speed mode.

If a large number of batteries are encountered in this state in your project, please contact OLPC; there is a possibility that a special EC firmware could be produced to reprogram batteries in this condition.

Laptop shuts down abruptly with significant charge remaining

The reason for this may be that the Laptop fails to (fully) charge the battery. Please continue in the following section: #Battery capacity is significantly degraded

Battery capacity is significantly degraded

If you have determined that the battery capacity is degraded through one of the following methods:

  • You have noted that the laptop shuts down abruptly while the battery still has a significant amount of charge
  • You have tested the capacity of the battery and have found it to be much lower than the rated capacity of 3000mAh
  • The battery refuses to charge (the battery behaves as if it is completely discharged, i.e. it cannot power the system alone, but connecting AC power causes the battery LED to go green immediately)

In this case, if the battery is a LiFePO4 battery with a yellow label, it could be that the battery cells have become inbalanced. See the XO LiFePO4 Recovery Procedure. Note that this problem was common on early XO-1 batteries, but is rarely seen on more recent models.

If you reach this point and the LifePO4 recovery procedure doesn't help, you're unfortunately at the end of the road. It seems that the battery's internal resistance is too high to allow charging. You should discard the battery in an appropriate recycling facility.

Techniques

OK prompt

Some of the procedures on this page require you to have access to the OpenFirmware Ok prompt. This may require a developer key to "unlock" the machine. See the Ok page for directions.

batman

NOTE: batman is incompatible with XO-1.75. Any repairs done with batman must be performed on a XO-1 or XO-1.5 laptop.

Note: The q2e32 OLPC firmware pulls in some of the commands from batman.fth

batman.fth is a forth script that is available from http://dev.laptop.org/pub/firmware/scripts/batman.fth. To use it you must load it at an Open Firmware (OFW) prompt. Getting to an OFW prompt requires a developer key. To use:

  1. Place batman.fth on a USB key
  2. Insert the USB key into the laptop XO (while it is turned off)
  3. Start the laptop
  4. Enter Open Firmware by pushing the ESC key while the laptop is starting up.
  5. At the 'ok' prompt, type:
fload u:\batman.fth

The batman script may be stored on devices other than a USB key. It is loaded with the 'fload' command, which must specify the storage device where bathman.fth is located:

USB disk:
 fload usb:\batman.fth
SD card:
 fload sd:\batman.fth
NAND flash (root directory):
 fload nand:\batman.fth

Once loaded you run the commands in the script just like any other OpenFirmware command. If you turn off the laptop, you have to repeat the loading process.

Key tools in batman.fth

The following is a list of useful tools in batman.fth with a brief note how to use them. Some of these commands require that the EC be put into reset prior to running them so that the EC battery management system is disabled. The 1w-init command does this. After the 1w-init command is used all keyboard, touchpad and button activity is disabled. Including the power button. Any command requiring a 1w-init will require that any further commands be invoked using the processor serial port. To power off the laptop afterwards, you will have to remove both external power and the battery. (note: if you came here from LiFePO4 Recovery Procedure you only need to run the bat-recover command)

  • batman-start
Put the EC in reset and prepare the system so that Open Firmware can talk directly to the gas gauge chip in the battery. Newer firmware only suspends the battery interface and leaves the keyboard working. Required prior to some of the other commands.
ok batman-start
  • batman-stop
undoes what batman-start did.
ok batman-stop
  • see-bstate
Continually prints the EC 1-wire communication state machine index. Useful for determining if the EC can talk to the battery gas gauge.
ok see-bstate
  • bat-recover
Does PWM on the charge enable line resulting in a psuedo-current limited charge of the battery. Streams the battery temperature, currrent, voltage and accumulated charge register (ACR) to the screen.
Automatically runs batman-start.
Remove the battery to cause bat-recover to exit (with an error message).
ok bat-recover
  • bat-set-low
Zeros out various values in the battery's gas gauge EEPROM forcing the EC to resync with the state of the battery. Useful if your battery is marked as full when it really is not.
Needs batman-start.
ok batman-start bat-set-low


Capacity test

Currently this tool (a Linux script) is located at /usr/bin/olpc-pwr-log, source at http://dev.laptop.org/git/projects/olpc-utils/tree/usr/bin/olpc-pwr-log

To use olpc-pwr-log follow the following procedure:

  1. Enter olpc-pwr-log in a Terminal.

The script will wait until it detects a battery and then begin to log various parameters via the olpc-battery subsystem. If your battery is really low and the EC is using trickle charge rather than main charge then the script will appear to be still looking for a battery even though the yellow charge LED is on. Once the EC finishes trickle charging it will report that a valid battery is present and the script will continue.

The output of the script is both to the screen and to a file. The file name is 'pwr-<date>-<gauge ID>.csv'. Gauge ID is a unique ID number that is contained in the gas gauge of each battery.

More details are in XO power draw.

Multimeter test

The battery has three terminals that connect to the laptop, you need to measure the voltage across the middle terminal and the one closest to the center of the battery. If your multimeter probes are too big to enter the terminals, find a couple of thin paperclips (or another type of thin wire) and feed it into the terminals, then you can connect the multimeter to the clip.

For a good battery with some charge, expect a reading between 1V and 7V. If the multimeter reports 0V here, it suggests that there is a bad connection between the cells and the battery connector, or that the protection circuit has permanently failed. Both cases would indicate that the battery is permanently damaged and cannot be recovered.

Tips

Estimates

A battery is a chemical device whose characteristics change with age, history, and ambient temperature. The charge amount shown in the frame is only an estimate. Do not worry if your battery shows (for example) 96% charged, or does not reach 100% charge.

Minimizing battery depletion

Even when powered off (by choosing Shutdown from the Home view), the XO has slight power draw, losing about 2% charge a day. If you won't be using the XO for a while you can avoid this by removing the battery from the XO after powering off.