libera/#maemo/ Sunday, 2023-01-01

joergakossh: ++14:50
joergsicelo: I think akossh is right, it's a dynamic result that gets reset to zero as soon as it doesn't make sense anymore14:51
joergsicelo: >> The taper detection conditions must be maintained for 4 successive average current measurements<< and one measurement (or for sure 4) that does not meet conditions will result in IMIN=014:54
joergthat's my guess14:55
* joerg wonders if N900 bq27xx chips ever been programmed to an adapted EEPROM config. IIRC for openmoko batteries they were not14:57
joerghttps://termbin.com/rp2s15:02
joerg   0x76:        45  ILMD Initial Last Measured Discharge High Byte     914  µVh (1)  R/W15:10
joerg                    *0x100 * 3.57 / 20 =  2062 mAh fabcoded cell capacity15:10
joergso forget it, it's bogus I'd say15:10
joergPack Configuration (PKCFG) — Address 0x7C : 67d = 0b0100 0011;  QV1 & QV0 These bits set the minimum qualification voltage for charge termination  -> 1 0 = 406415:25
joerghttps://i.imgur.com/32kwtjX.jpg15:27
sicelohi :-)15:29
siceloyes, that's where i got the 4064mV i mentioned earlier15:29
siceloand yes, looks like IMIN=1 from when it becomes full (from charging), and stays that way until 4064mV is reached, even momentarily.15:30
sicelohttps://paste.debian.net/1265870/ - when 2nd column has "Full", that's when IMIN=115:32
siceloi think the battery is a bit weak, and the system is drawing a lot of current, hence we drop quickly to IMIN=015:33
joergthe values of bq27k EEPROM in N900 are bogus/default, in my book15:35
joergdoesn't look like Nokia went to the extent to actually program those chips to something meaningful15:36
joergand the BME proprietary closed blob that "makes your eyes bleed" when you had a chance to look at the source, didn't bother about any such states in bq27k anyway15:38
siceloi agree re:programming, but i think the values themselves are correct. i'd say they're the default values15:38
joergsure, they are TI factory defaults I'd say15:39
siceloagreed :-)15:39
joergcheck 0x6E:         0 EE_EN EEPROM Program Enable15:39
siceloi have been playing with bq because upower has issues with it, and i would like to find a way to make it work perfectly ootb15:40
joerg>> This register is used to enable host writes to EEPROM data locations (addresses 0x76 — 0x7F). The host must write data 0xDD to this register to enable EEPROM programming. See the Programming the EEPROM section for further information on programming the EEPROM bytes. Care should be taken to insure that no value except 0xDD is written to this location.15:40
siceloin particular, upower does not like  to see capacity = 0, which can happen easily on N900, especially if you charge externally15:42
sicelomaemo leste has patched upower, but i also use other OSes on the N900, e.g. postmarketOS. they have many other phones, so they're not very keen on upower hacks, since what works for one might not work for the other15:44
joerg>> The bqJUNIOR has 10 bytes of EEPROM that are used for firmware control and application data (see the bqJUNIOR Register Descriptions section for more information). Programming the EEPROM should take place during pack manufacturing because a 21 V pulse is needed on the PROG pin.<< which makes moot a lot of features the bq27k *could* support, because you can't program reasonable config values to the EEPROM, particularly for stuff like taper current threshold,15:47
joergend-of-charge cell voltage etc pp15:47
joergto put it plain and unambiguous: a chip $XY like for example bq27xx in one implementation and hw platform my act different that same chip in another circuit/implementation/hw-platform. No way to make a generic reliable full featured API for such a chip, unless you handle config options which are nothing else than hacks15:50
joergs/my act/ may act/15:50
joergI had such discussions about kernel and platform specific adaptions which can _not_ completely taken care of by device tree or whatever other generic means. That's why I think you'll always want a platform specific kernel / modules15:59
siceloi agree that the generic module leaves out other properties16:12
sicelofor example, recently i added https://lore.kernel.org/linux-pm/20220420123059.1206443-1-absicsz@gmail.com/T/#m2c1d4196cd9c5be45f2671e5bebec5dd18d1535e , so i could get *some* capacity even if CI=0. previously, driver unconditionally returned ENODATA for mort of the properties, until calibrated16:19
joerg>><sicelo> in particular, upower does not like  to see capacity = 0, which can happen easily on N900<< well, it's a completely correct value for "state of charge" since in N900 this is NOT meant to provide the ACTUAL state of charge of a battery that just got inserted. Though BQ27k is "BATTERY GAS GAUGE IC" it isn't exactly meant nor working that way in N90016:19
joergCI=1 you meant?16:20
siceloyes, sorry16:20
joerg>>CI    Capacity Inaccurate flag. A 1 indicates no valid learning cycle.<<16:20
sicelowell, it's a completely correct value for "state of charge" since in N900 << ... i completely agree. that's why i think upower needs to take other factors into account, and not just rely on CAPACITY only16:21
joergyep16:21
joergat least not on "capacity" from bq27k, only16:22
siceloit's not only bq27k that has this issue. even Droid 4's cpcap has same (or worse!)16:22
joergsince bq27k in N900 is _not_ a reliable batt gas gauge, it's only used to measure currents and voltage of battery which are always reported correctly16:23
sicelohttps://gitlab.freedesktop.org/upower/upower/-/merge_requests/40#note_169346816:23
sicelohttps://gitlab.freedesktop.org/upower/upower/-/issues/218#note_169215616:23
joergfreedesktop... ohmy16:25
sicelo:-D16:25
joergpoetterspecs?16:26
siceloi honestly will be happy when upower dies16:27
sicelounfortunately, it is the de facto standard atm, so yeah16:27
joergthings about cats in movies you can't do anymore https://youtu.be/qOj0RdpirrI?list=PLuoTtPxIOh1P-xJ-lcjxZOE2MKrI6P0lM&t=7816:39

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!