« Gitolite | Home | OpenStreetMap's Role in Haiti »

February 10, 2010

The Mysterious Missing Milliamps

My new A7+ Freerunner arrived a few days ago.  Before long I'd flashed it with the latest version of SHR-testing, made sure stuff worked, and moved my main SIM over to it.  Then I set about installing all the most cutting-edge unstable userspace and 2.6.32 kernel stuff on the old A6 Freerunner ready to have some fun.  But I quickly noticed that something wasn't right - it wouldn't charge properly.  During my first Sunday hacking session, it didn't seem to be able to charge from a USB connection to my computer, and seemed to be getting quite warm to the touch as well.

The current_now sysfs node indicated that the device was using many hundreds of milliamps more current than it should have been.  So much, in fact, that the current provided to it over USB by my laptop wasn't enough to charge the battery - with barely enough power to keep the thing running the battery slowly discharged.  With the higher current provided by the mains charger, the battery would charge, but more slowly that normal.  But this only seemed to happen with the 2.6.32 kernel.

Lots of discussion on IRC (mostly with DocScrutinizer) followed, and it emerged that one possibility was a short circuit in the uSD card slot.  Sure enough:  I'd moved my uSD card from the A6 to the A7+ Freerunner (since the new one didn't come with a card), leaving the A6's SD slot empty.  On my device, some of the pins protruded up, perhaps enough to short out against the metal SD slot lid:

p2100009 (Modified).jpg
I cut a roughly 1x1.5cm rectangular piece of plastic from the packaging of some small halogen bulbs I'd bought the previous day, and put it into the slot as a "dummy".  Testing again: no current drain.  Dummy removed, the drain came back, and so on.  The Doc had hit the nail on the head - the culprit was found!

But there was one more piece to the puzzle.  Why didn't the drain seem to happen with the older 2.6.29 kernel?  Turns out that a small detail had been left out from the kernel during an earlier merge.  Because of this, the Glamo SD engine's power supply was left on all the time, when normally it should get switched off when no SD card was present.  The resulting waste of a small amount of power became a huge power drain when the short circuit was added.  Hopefully the SD electronics aren't too fried..

1 Comment

Nice, to consider why such SD Slot is not isolated from the beginning?

Latest QtMoko v19 with kernel nodebug kicks ass.
Just done some fixes in my A5->A6
(nobat and reclamping fixes)
testing now how long FR will alive without recharge.

Some news with KMS/Gfx?

Best Regards.

Leave a comment