Editing N900 Software BME

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 9: Line 9:
* hald-addon-bme - an add-on process for HAL that reports status.
* hald-addon-bme - an add-on process for HAL that reports status.
* bme_RX-51 - Process started early in boot, with watchdog tickling of the watchdog in chip, configuring the charger chip, selecting charge current etc.
* bme_RX-51 - Process started early in boot, with watchdog tickling of the watchdog in chip, configuring the charger chip, selecting charge current etc.
 +
 +
The kernel driver is split over several files.
The kernel driver is split over several files.
Line 14: Line 16:
http://mxr.maemo.org/fremantle/source/kernel/include/linux/i2c/twl4030-madc.h
http://mxr.maemo.org/fremantle/source/kernel/include/linux/i2c/twl4030-madc.h
This handles reading various ADCs to readout voltages, currents and BSI.
This handles reading various ADCs to readout voltages, currents and BSI.
 +
'''BSI''', or battery size indicator is the third pin of the battery. Resistance between the - pin and third pin on battery is measured by BME through twl4030-madc, and mapped into a capacity in mAh. BME noticeably uses this as a reference "full" value for the battery meter, and possibly for other uses as well. Here are some experimental results, all resistance readings are to be considered inaccurate at best:
'''BSI''', or battery size indicator is the third pin of the battery. Resistance between the - pin and third pin on battery is measured by BME through twl4030-madc, and mapped into a capacity in mAh. BME noticeably uses this as a reference "full" value for the battery meter, and possibly for other uses as well. Here are some experimental results, all resistance readings are to be considered inaccurate at best:
Line 24: Line 27:
Unsorted adds:
Unsorted adds:
-
* Then there's also <code>/usr/lib/hal/hald-addon-bme</code>, which seems not to be completely out of order (according to lshal) even when bme_RX-51 is stopped.
+
* Then there's also /usr/lib/hal/hald-addon-bme, which seems not to be completely out of order (according to lshal) even when bme_RX-51 is stopped.
 +
 
* Mer 'replacement hald-addon-bme': http://gitorious.org/mer-toggles/hald-addon-bme/blobs/master/hald-addon-bme.c [[Mer/Documentation/BME_Protocol]] (N810!)
* Mer 'replacement hald-addon-bme': http://gitorious.org/mer-toggles/hald-addon-bme/blobs/master/hald-addon-bme.c [[Mer/Documentation/BME_Protocol]] (N810!)
 +
* <code>lsof -p `pidof bme_RX-51`</code> gives an idea about what BME is actually interfering/interfacing with, and a strace will show it talks to dsme_lib probably to implement the watchdog timers.
* <code>lsof -p `pidof bme_RX-51`</code> gives an idea about what BME is actually interfering/interfacing with, and a strace will show it talks to dsme_lib probably to implement the watchdog timers.
 +
* BME process/file is called <code>/usr/sbin/bme_RX-51</code> and killing or sigstop'ing it will cause immediate or delayed reboot. It is easily suspended though through upstart process management by:<br /><pre>~>stop bme</pre>and resumed any time by:<br /><pre>~>start bme</pre>
* BME process/file is called <code>/usr/sbin/bme_RX-51</code> and killing or sigstop'ing it will cause immediate or delayed reboot. It is easily suspended though through upstart process management by:<br /><pre>~>stop bme</pre>and resumed any time by:<br /><pre>~>start bme</pre>
Line 41: Line 47:
Editing this without understanding can CAUSE YOUR N900 TO CATCH FIRE.
Editing this without understanding can CAUSE YOUR N900 TO CATCH FIRE.
-
==Replacement Goals==
+
=Replacement Goals=
-
===Alpha===
+
==Alpha==
* Not make the battery explode.
* Not make the battery explode.
* Charge from any 5V source, assuming the battery is in a safe condition, just setting the charger chip to the end voltage, and resetting the watchdog.
* Charge from any 5V source, assuming the battery is in a safe condition, just setting the charger chip to the end voltage, and resetting the watchdog.
-
===Beta===
+
==Beta==
* Watch the state of the battery, and charge taking into account device load.
* Watch the state of the battery, and charge taking into account device load.
** Battery charger chip should be configured to float the battery at a current which slightly exceeds the desired float current, and the charge normally terminated when the actual battery current measured by the bq27200 reaches the 'taper' value. A simple way to measure this is if the 'time till full' field goes to 65535. This ensures a consistent shutoff taper current, which the battery charger alone cannot do.
** Battery charger chip should be configured to float the battery at a current which slightly exceeds the desired float current, and the charge normally terminated when the actual battery current measured by the bq27200 reaches the 'taper' value. A simple way to measure this is if the 'time till full' field goes to 65535. This ensures a consistent shutoff taper current, which the battery charger alone cannot do.
-
===Gamma===
+
==Gamma==
* Charge at appropriate limits for USB chargers, and USB hosts we are plugged into.
* Charge at appropriate limits for USB chargers, and USB hosts we are plugged into.
* Monitor and reset from abnormal conditions - incorrect 'battery missing' and other error codes. Capacity and charge data from bq27200 can be very inaccurate if the phone has not appropriately learned the capacity of the battery, or if it erroneously detects battery full due to a high impedence battery or poor contact.
* Monitor and reset from abnormal conditions - incorrect 'battery missing' and other error codes. Capacity and charge data from bq27200 can be very inaccurate if the phone has not appropriately learned the capacity of the battery, or if it erroneously detects battery full due to a high impedence battery or poor contact.
-
* If phone is in active use, and charger or USB is plugged in, maintain a constant battery voltage somewhat under the peak charge voltage, without regards to taper current. (To keep phone charged, but not degrade battery with pointless micro-cycling, or high float voltage)
 
-
[[Category:N900_Hardware]]
+
* If phone is in active use, and charger or USB is plugged in, maintain a constant battery voltage somewhat under the peak charge voltage, without regards to taper current. (To keep phone charged, but not degrade battery with pointless micro-cycling, or high float voltage
 +
)
 +
[[category:N900_Hardware]]

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)