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 the laptop from booting.
Problem Description
XO 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.
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
Examine the battery and its holder
To access the Real Time Clock battery, follow the instruction for removing the back cover.
XO-1
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.
Examine the battery and its holder. Is there signs of acid leakage? Does the battery appear secure in its holder?
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 is 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.
- Neutralise 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 production units 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 show the shape as follows:
(_____)
However, the shape of the defective units is more like:
\_____/
(these crude diagrams are exaggerated)
If your XO suffers from this problem, you must re-seat the coin cell battery in its holder 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 even think of "Gorilla Glue"; that's polyurethane, which foams as it cures.
- RTV silicone would be good, except that the common variety releases corrosive acetic acid as it cures - if it smells like vinegar, don't use it on electronics.
- Ordinary "white glue" (PVA, or polyvinyl acetate) will probably work, but it flows easily and goes down underneath the battery - that is probably okay if you are careful not to use too much.
- Hot melt glue doesn't work, because it doesn't stick very well to these materials.
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 stored away from the motherboard in shrink tubing, connected with a socket-secured cable, a further attempt to reduce the frequency of RTC battery-related problems. The tubing is then loosely stuck down to the motherboard to prevent it from moving around.
Even though the same standard coin-cell is in use, replacing the battery here is non-trivial. The shrink tubing will be destroyed as you open it, and you also have the problem of connecting the wires to the 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), however you may be able to find a source where you can purchase leggy battery replacements (e.g. here, maybe).
The more sensible option would be to take the entire component (connector + cable + tubing + battery) from another laptop (or 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
The most simplistic situation is when Linux can be booted - for example, the system has activation security disabled, or the dateless system is able to retrieve an activation lease as it is booting.
Once Linux has booted, login at a a root terminal (e.g. press Ctrl+Alt+F1).
Set the current UTC date/time using the date command, e.g. for the current date/time:
date --utc -s "2024-08-25 05:02:17"
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 17 02 05 25 08 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.
As there are numerous opporuntities for error, it is suggested practice to test serial console communications with a known good laptop before debugging broken ones!
- Using an OLPC serial adapter, connect the laptop to your personal laptop. 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 minicom (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.
- 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.
- 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 17 02 05 25 08 2024 set-time
At this point, you are strongly advised to perform a firmware update 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 be as painful.
- Insert a USB key containing the latest firwmare 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, we must now verify that the laptop is able to retain the time and date, otherwise this problem will 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 indiciates 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.