Fix Clock
This page describes how to fix a XO laptop suffering from problems with the Real Time Clock. If the laptop has security enabled, this problem will prevent an XO-1 from booting.
Problem Description
XO-1 laptops with this problem show one of two symptoms:
- The laptop screen lights up and shows "Invalid System Date" and then powers off, or continues to boot, seeking an activation lease. Activating the laptop will result in the laptop working temporarily, but returning to the same problem on next boot.
- The power LED turns on, but the screen never turns on (not even the backlight). The microphone LED may flash briefly, but stays off. This symptom can only happen on XO-1 with very old versions of OFW (Q2D05 and Q2D06).
The problem is caused by bad date information stored in the Real Time Clock (RTC) chip. There are three ways that the date could become bad:
- The RTC chip lost all power. The RTC chip has a "coin cell" backup battery (ML1220) that powers the RTC chip when the AC and the main battery are not present, but unfortunately, problems with this backup battery are common.
- Some of the early production XO-1 machines were manufactured with a defective holder for the coin cell battery. On those machines, the coin cell battery can become loose or even pop out entirely during normal shipping and handling.
- Another occasional problem is leakage or corrosion from the battery, causing a loss of contact between the battery and the metal contacts inside the holder. Some photos here.
- It is also possible (and not too uncommon) that the coin cell battery simply does not work (or has ceased to work).
- The factory did not set the date. This is rare.
- The user explicitly set the date to an incorrect value, either by mistake or as an attempt to defeat activation security. This is also rare.
"RTC chip lost power" is by far the most common cause of the problem.
XO-1.5 laptops do not suffer from this particular problem.
Repair process
The overall process is:
- Examine the battery and its holder, securing the battery in place if necessary
- Reprogram the time and date
- If running a very old version, update Open Firmware to the current version.
- Perform a verification test
Here are English and French diagrams of the process:
Examine the battery and its holder
To access the Real Time Clock battery, follow the instruction for removing the back cover.
XO-1
Examine the battery and its holder. Is there any sign of acid leakage? Does the battery appear secure in its holder? On newer models of the XO-1, the RTC battery and its holder may be covered by a circular strip of rubber (a hardware improvement attempting to reduce the frequency of this issue). You can remove this cover simply by peeling it off.
Remove the battery from the socket. Check for signs of leakage underneath the battery, in the holder, and on the motherboard and components around the battery holder.
If there are signs of battery leakage:
- Remove the leaking coin cell battery and discard it.
- Carefully clean any leakage/corrosion in the battery holder, using e.g. a damp toothbrush.
- Neutralize the leakage/corrosion area with some baking soda.
- Using a magnifying glass, look for damage to surrounding components or electrical tracks
- If present, you are advised to treat the motherboard as broken or dead-on-arrival.
- Obtain a replacement cell battery (these parts are very standard) and install in the socket.
- Any decent electrical/DIY store will stock these, they are known as ML1220 batteries and commonly found in calculators.
If the battery does not fit well in the socket, carefully examine the shape of the socket. Early laptops had a defective battery holder, pictured here. The photos do not make the problem very obvious; the issue is that the shape of the battery holder does not 'grip' the battery. In other words, a side angle view of the battery holder should be shaped like this:
(_____)
However, the shape of the defective units is more like:
\_____/
(these crude diagrams are exaggerated)
If your XO has a defective holder, you must re-seat the coin cell battery and secure it so it doesn't come out again. This can be done by putting a drop of glue where the battery contacts the holder, away from the metallic contact.
- The best glue that Mitch has found for this purpose is clear solvent-based household cement. Technically, it is "nitro cellulose" cement. It is also known as "model airplane glue", marketed under various trade names such as "Duco Cement", "Tarzan's Grip". Loctite "Stik'n Seal", etc (Alleskleber, in Germany, maybe?). The solvent in this kind of cement is toxic and flammable, so keep it away from children!
- Stronger adhesives like epoxy or cyanoacrylate (super glue) would probably work too, but it might be difficult to remove the battery later without damaging the holder.
- Don't use "Gorilla Glue"; that's polyurethane, which foams as it cures.
- Don't use RTV silicone; the common variety releases corrosive acetic acid as it cures - if it smells like vinegar, don't use it on electronics.
- Don't use hot melt glue; because it doesn't stick very well to these materials.
- Ordinary "white glue" (PVA, or polyvinyl acetate) will probably work, but it flows easily and goes down underneath the battery - perhaps okay if you are careful not to use too much.
If your XO had a black rubber strip covering the battery in the holder, install the cover again now.
XO-1.5
On the XO-1.5, the RTC battery is not in a holder. The battery is encased in shrink tubing, and connected to the motherboard with a short cable. (Eliminating the socket was an attempt to reduce the number of socket issues experienced on XO-1.) The battery, in its protective tubing, is stuck down to the motherboard to prevent it from moving around.
Even though the same standard ML1220 coin-cell is used, replacing the battery alone is difficult. The shrink tubing will be destroyed as you open it, and it will be difficult, and perhaps even dangerous, to reconnect the wires to a replacement battery.
- It may be possible to repair the tubing with some tape, or to discard the tubing and create your own enclosure with some electrical tape.
- The battery shipped in the laptop is a leggy battery - it has the wires spot-welded to the battery during fabrication. It is a very bad idea to attempt to solder wires to a new battery (it can explode). It is far better purchase leggy replacement batteries (e.g. here, maybe).
If available, one could also take the entire component (connector + cable + tubing + battery) from another laptop, or from a spare parts supply sourced from OLPC.
Reprogram the time/date
Note that in all cases, the date/time should be set to the Coordinated Universal Time value, rather than the time in your local timezone.
If the screen turns on and you can boot into Linux
This is the best situation to be in. It happens if the laptop has activation security disabled, or the laptop without a date is able to retrieve an activation lease.
Once Linux has booted, login at a root terminal (e.g. press Ctrl+Alt+F1).
Set the system time using the date command, e.g. for the current date/time:
date --utc --set="2024-11-22 14:48:44"
Then shutdown normally and the system time will be stored in the clock.
(Don't force a shutdown by holding down the power button, because then the change won't be stored.)
If the screen turns on but you cannot enter Linux
Reprogramming the time and date can also be done through the OpenFirmware ok prompt.
If there is something visible on the display, you simply need to disable the XO laptop security system and press the escape key once you hear the bootup sound to access the OpenFirmware prompt.
In order to disable the security system (assuming it is enabled, which is generally only true for large deployments and G1G1 customers), you will need a "developer key" for this machine, on a USB storage stick.
Turn on the XO and hit Escape upon hearing the bootup jingle.
At the ok prompt, type these commands to set the date (hitting enter after each one):
ok select /rtc ok decimal ok sec min hour day month year set-time
sec, min, hour, day, etc in the previous command should be numbers correlating to the current date. For the current time:
ok 44 48 14 22 11 2024 set-time
You can now turn off the machine by pressing the power button for a few seconds.
If the screen does not turn on
Very old versions of OpenFirmware for the XO-1 laptop had a bug which would cause the screen to fail to power up when this RTC clock problem was encountered. If this happens, the recovery procedure involves linking up a special cable to another computer, and then using that other computer to reprogram the time and date.
(There are numerous opportunities for error, so if you have more than one XO-1 laptop practice serial console communications with working ones before debugging broken ones)
- Using an OLPC serial adapter, connect the laptop to your personal laptop or computer. On the laptop's motherboard, the serial adapter should be connected to J1. J1 is a small white connector near the wireless module.
- Use a program like screen (for Linux) or HyperTerminal (for Windows) to access the laptop serially.
- The serial port settings should be 115200 baud, 8 data bits, no parity, and 1 stop bit and handshake parameter is disabled; only the baud rate needs to be set on Linux, the remaining settings are the default.
- Power on the laptop under test. You should see "Page Fault" on the serial terminal, followed by an "ok" prompt. If you don't see "Page Fault", there are several possibilities:
- If you don't see anything on the serial terminal, either
- The serial terminal is not connected correctly, or
- Something else is wrong with the machine - the machine is quite quite dead and it's not an instance of the symptom 1 RTC problem.
- If you see a lot of startup messages, and the last one isn't "Page Fault" followed by "ok", then the machine is not suffering from the known RTC problem, but may have a dislodged backlight cable.
- If you don't see anything on the serial terminal, either
Using the "other" laptop that is connected serially to the affected XO, type these commands at the ok prompt (hitting enter after each one):
ok select /rtc ok decimal ok sec min hour day month year set-time
sec, min, hour, day, etc in the previous command should be numbers correlating to the current date. For the current time:
ok 44 48 14 22 11 2024 set-time
At this point, update the firmware to a version that does not suffer from this blank-screen problem. That way, if the RTC loses power again, your diagnosis/recovery procedure will not need a serial adapter.
- Insert a USB key containing the latest firmware version. You will need to download the .rom file and place it on the key.
- To update the firmware, type the following command line at the ok prompt, substituting the correct .rom filename:
ok probe-pci probe-usb flash u:\q2d16.rom
Perform a verification test
With the clock reprogrammed, you should verify that the laptop is able to retain the time and date, otherwise this problem may resurface.
- Unplug the charger if it is plugged in.
- Remove the regular XO battery from the underside of the laptop (Note: this refers to the main battery that is charged through AC power, and can be easily accessed by turning the laptop upside down. It does not refer to the coin cell battery, which you should not touch at this point).
- Leave the laptop in this state for 3-5 minutes
- Connect a power source (the battery, or the charger) and turn on the laptop
- Look carefully for an "Invalid System Date" error message appearing immediately
The lack of an error message indicates that the repair was a success. You may wish to go into Linux and run date in the Terminal activity to verify that the clock was programmed correctly, although this should not be necessary.
If there is an error message, then 3 situations are possible:
- The RTC coin-cell battery is faulty and must be replaced.
- You can verify this by installing a known-working battery, reprogramming the clock, and then repeating this verification test. Test pass would confirm this problem.
- There is a problem with the battery holder or the motherboard, so the laptop should be replaced.
- You can verify this by installing a known-working battery, reprogramming the clock, and then repeating this verification test. Test fail would confirm this problem.
- If you are dealing with a defective shape battery holder, perhaps the RTC battery is (still) not maintaining electrical contact with the connector inside the battery holder.
Automated repair script
Repair center volunteers have created an automated python script that can be used to repair machines in bulk or simply as a method with fewer instructions. The script can be run on a typical Linux machine or on an XO. We call this 2nd computer your "debricker" machine.
The script you will run on the "debricker" can be found here:
The upstream git repository for it is in the olpc-contrib repository located here:
To use the script you must first install pyserial. You must be online when running (any of) the three following commands:
For Ubuntu or Debian:
sudo apt-get install python-serial
For Fedora, such as on an XO::
sudo yum install -y pyserial
Wait for the install to complete.
Then download and install d6.py by typing:
wget --timestamping http://dev.laptop.org/~rsmith/d6.py
Connect up the proper serial adapter between the bricked XO (serial end of the cable) and the debricker computer (USB end of the cable). Then type -- always on the debricker (i.e. working!) machine:
python d6.py
Or if d6.py has been marked executable then you can execute it directly with:
./d6.py
The script will search for the first serial port on the system that is available for use. If your serial connection for the XO is not on the first available port then either modify the script to look for the other port fist or open the other serial port with another program so its not available for use by d6.py.
Once the script is up and running then connect up a bricked XO and power it on. When the screen on the bricked XO lights up, or you hear the startup sound, it's finished (debricked!)