XO Troubleshooting Battery
- 1 Start Here
- 1.1 The laptop won't run using the battery
- 1.2 The battery light is flashing red
- 1.3 The battery light is flashing yellow
- 1.4 The laptop can't charge the battery
- 1.5 The laptop won't run using the power adapter
- 1.6 The laptop emits a high pitched whine when using the power adapter
- 1.7 Laptop abruptly shuts off before battery's capacity reaches < 10%
- 1.8 Laptop recognizes the battery, reads its charge percent & voltage properly but does not charge it
- 2 Diagnosing Battery Problems
- 2.1 Did the EC boot?
- 2.2 Does the EC recognize the battery?
- 2.3 Common Causes for lack of battery presence
- 2.4 Battery LED is flashing red
- 2.5 Battery fails to charge?
- 3 Tips
- 4 Software Tools
What problem are you experiencing with your laptop ?
The laptop won't run using the battery
If the laptop functions fine using a known good test battery, the battery should be replaced.
If the laptop doesn't function from a known good test battery, see Diagnosing Battery Problems.
The battery light is flashing red
If the battery light is flashing red, this usually indicates an error with the battery. Try a full reset. If the problem persists, then the battery should be replaced. ( For more information on the battery led see  )
If the replacement battery shows the same flashing red battery charge light, see common causes for lack of battery presence, below.
It is possible to obtain more information about the battery, and possibly repair it. See below.
The battery light 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.
Trickle charging occurs when the battery voltage is lower than 5.4V. This can be monitored with the watch-battery firmware command detailed below.
The laptop can't charge the battery
If the laptop can charge a known good test battery, the battery should be replaced.
- If the battery is a LiFePO4 battery, with a yellow label, see the LiFePO4 recovery procedure.
If the laptop can't charge the known good test battery, see Diagnosing Battery Problems.
The laptop won't run using the power adapter
If the laptop runs fine using a known good power adapter, the power adapter should be replaced.
If the laptop can't run from a known good power source:
- Does the battery charge LED indicate the laptop thinks it has power ? With a battery inserted, the battery LED should turn yellow or green within a minute of applying power. In this case, the laptop probably has a startup problem, not a power problem.
- Otherwise, the motherboard needs replacement.
- Suspect components are the fuse F1 (2A) and diode D21 (3A schottky) on the motherboard protecting the DC input. If the fuse was blown, check diode D123 (3A schottky) and diode D118 (38V zener) to see if they are OK.
The laptop emits a high pitched whine when using the power adapter
The whine is usually the result of lower-than-normal input voltage or current from the external adapter. The whine comes from vibration in the coils in the inductor -- if the whine is extreme, and goes on for a very long time, there's some chance of the insulating varnish on the coils being harmed, but for all practical purposes, the whine is perfectly safe.
Laptop abruptly shuts off before battery's capacity reaches < 10%
The reason for this may be that the Laptop fails to (fully) charge the battery. Please continue here.
Laptop recognizes the battery, reads its charge percent & voltage properly but does not charge it
Another behaivour is that Laptop does not work without power source (despite being battery fully charged). It would go to a state of power off, and when you try to power it on, power & battery leds will toggle continiously while holding power on button pressed. But, for this problem, battery loads sugar and works properly all its functionalities when AC plugged.
- Solution: This problem fixes by replacing Q32 component, it's a transistor wich drains power to/from battery when charging/discharging.
Diagnosing Battery Problems
Charging of the battery, and interpretation of the front panel buttons, is under the control of a separate microprocessor in the laptop, the Embedded Controller (EC). In order to ensure that battery communications are being properly handled, we must first establish that the EC is operating correctly:
Did the EC boot?
Follow the Full Reset procedure, and check to see if the battery LED flashes orange momentarily after reapplying one source of power. The flash is very brief, less than half a second, and occurs only once each time the first source of power is applied.
If it didn't flash at all, you probably have a broken motherboard.
If it flashed another color (red or green), then you probably have a problem with the LED or LED driver circuitry.
To check the EC is running properly, try removing the battery and powering up the laptop without it. Replace the battery after the laptop is running.
Does the EC recognize the battery?
When a battery is inserted into the laptop, the EC reads information about that battery from a integrated circuit inside the battery. If the EC does not receive valid information from this read, it will either assume that a battery does not exist, or report an error. The following tests tell if the EC is talking the battery correctly.
Does the battery light respond to changes in external power?
When you apply external power, the battery led should light up in one of four states:
- solid green - indicates a fully charged battery
- solid yellow - indicates a battery being charged
- flashing yellow - indicates a battery being trickle charged
- solid red - indicates a battery in dire need of charging
- flashing red - indicates a battery error. See above and a detailed explanation below.
If the battery light does not indicate one of these states (e.g. nothing lights up) then the battery is not being recognized. If you get a solid battery light then the EC has successfully read the battery gauge. If the battery light stays unlit then either the battery is not recognized or the data read has confused the EC. Use one of the following methods to manually check for battery presence to determine the problem.
For more information on the battery led see 
Checking for battery presence
The following methods may be used to manually check for battery presence.
Linux has an interface to the laptop's battery subsystem. Its available via sysfs at /sys/class/power_supply/olpc-battery/. The value of 'present' indicates if the EC thinks a battery exists. (A value of '1' indicates the battery is present). To check this value use the 'cat' command in the terminal app or at a vtty:
You will need a developer key for the laptop. Open Firmware has command that will talk to the EC and read the current battery info. This command is watch-battery. At the Open Firmware command prompt do:
If EC thinks a battery exists you should see a single line that gets updated with various pieces of battery information. If a battery does not exist then that will be indicated with a 'No battery' rather than battery status info.
Using OpenFirmware and batman.fth
You will need a developer key for the laptop. Recent firmware versions have Batman.fth commands that can interrogate the state machine of the EC's 1-wire interface. This allows you to see what's happening on the 1-wire bus. The command for this is see-bstate. If a battery is not detected the numbers printed will cycle between 0,1 and 2. Numbers other than that indicate the EC has detected a battery.
Common Causes for lack of battery presence
There are a number of possible causes for lack of battery presence. Here they are, in the order in which they should be checked.
Check to see that connectors CN21 (shown in picture) and CN22 on the motherboard are firmly plugged in. CN21 has a second connector, hidden in the bottom part of the laptop.
If no batteries are detected, a break or bad connection between CN22 on the motherboard and the data pin on the battery connector results in no 1-wire communication (seen as this problem). Check continuity of the cable with an ohm meter.
Bad data in battery EEPROM
Normally if the data in the EEPROM has been corrupted a flashing red LED error will result. However, depending on the corruption it may be possible to confuse the EC. Use a known good battery to ensure that the problem is with the battery and not the laptop.
A battery in this condition can be detected by watching the output of see-bstate.
One-wire Communication Error
The sensor inside the battery could be malfunctioning or the output from the EC could be corrupted from a manufacturing defect. If the laptop cannot communicate with the known good battery, and you have already checked for an unplugged cable or broken wire, then the error is in the laptop motherboard and it will need replacement.
Battery LED is flashing red
Flashing red LED indicates that the battery subsystem has detected an error. Open Firmware has a command that will read the error code from the EC. The command for this is 'ec-abnormal@'. At the Open Firmware prompt use the following to view the error code.
ok ec-abnormal@ .
Note the '.' at the end. This is required to print the error code.
For more information on the battery led see Power_management#Battery_LED
Common Error Values
- 02 Wrong Pack setting
- 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.
- 0b LiFePo4 Overtemp
- Battery got too hot. Turn off the system remove the battery and let things cool.
Fix BYD battery ID
One problem that will cause the "flashing red" problem is corruption within the memory in the gas gauge causing the battery identification data to be lost. In this case, watch-battery will report "No battery" and hitting Escape will identify that bank 1 is invalid.
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.
ok watch-battery AC:on Battery: No battery
Now hit escape.
Bank 1 Invalid ok
This means that the battery type is invalid. 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.
Battery fails to charge?
Checking the actual charge level
olpc-pwr-log is a Linux bash script that allows you to measure the amount of charge delivered to or extracted from the battery. It can be used to determine if the battery is performing at its rated capacity.
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.
Currently this tool (a Linux script) is located at http://dev.laptop.org/~rsmith/olpc-pwr-log
To use olpc-pwr-log follow the following procedure:
- Copy (or download) olpc-pwr-log to the XO. It does not need any special priviledge
- Start it
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 light 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.
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:
- Place batman.fth on a USB key
- Insert the USB key into the laptop XO (while it is turned off)
- Start the laptop
- Enter Open Firmware by pushing the ESC key while the laptop is starting up.
- At the 'ok' prompt, type:
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)
- 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.
- undoes what batman-start did.
- Continually prints the EC 1-wire communication state machine index. Useful for determining if the EC can talk to the battery gas gauge.
- 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).
- 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
Linux battery subsystem
More information needed here