Puzzling Battery Threshold Behavior

I enabled the battery charge threshold using framework_tools and set it to 80%.

Based on the ec source code I found on github, it looks like it’s supposed to do this:

0 ---------- 75 ------- 80 --------100
    Normal       IDLE      discharge

It does work normally below 75%. It does discharge the battery if it’s more than the threshold of 80%. But when it gets to 80% it doesn’t IDLE, it’s still pulling power from the battery. In IDLE mode I lose 1% of the battery per hour, so you’d assume it’ll take 5 hours to go from 80% to 75%, but it takes less than an hour, so it’s constantly charging and discharging the battery.

I also tested using the BIOS, and set the threshold to 60%, and saw the exact same issue.

This doesn’t make any sense to me, does anybody else see the same issue? It’s pulling a constant 5W-7W from the battery (the system is using more, so it drains slower than if it were not connected to the AC, but you’d assume in IDLE mode, it pull ~0W from the battery).

[The image is my current test with threshold at 60% via BIOS, you see it drained faster when it was above the threshold, and slowed down when it got to 60, but it’s charging and recharging that 5% every hour]

Here’s another image showing battery draining at 6W:

It looks like that only at 60% and at 56% it was actually IDLE:

I turned off Battery Extender in the BIOS. Didn’t change anything.

system info:
Vendor: INSYDE Corp.
Version: 03.20
Release Date: 06/23/2026
Address: 0xE0000
product: AMD Ryzen 7 7840U w/ Radeon 780M Graphics
vendor: Advanced Micro Devices [AMD]
physical id: 4
bus info: cpu@0
version: 25.116.1
I’m on PopOS 24.04

I know this reply is gonna seem a little far-fetched since I’m on a completely different system (i5 Framework 12) but in my experience, using a very high wattage charger (like 100W) will ensure that 0 watts are actually drawn from the battery at all times regardless of system load. If I use a lower wattage charger like a 45 watt one, which, according to the math, should sustain the entire system at max load, sometimes I catch the battery being drawn from by like 0.5W or so while the system is in heavy load with the 45W charger connected.

I might be spewing nonsense here, but you may want to try using a higher wattage charger before doing anything else.

I have a 100W power supply connected, and my system is pulling a lot less (20W max).
The draw from the battery is a constant 5W or 6W, regardless of the load.
Looking at the ec console log, it reports the battery “parked” only when the percentage is 60%, as soon as it gets below 60%, it starts drawing (not “parked” anymore, while reporting “not charging”) a constant amount until it gets to 55%.

This is definitely a bug. If you used a 45W or 60W charger and play video games it’ll slowly discharge at about 0.5W until it reaches 5% lower. It’s discharge above 80%, charge below 75% and idle at between 75 to 80%. If you start at 80% and a sharp pulse load drags the battery to 79% it should continue idling at 79%.

In OP’s computer, it can only idle at 80% a sharp pulse load drags the battery to 79%, instead of idling, it changes to discharge and discharges to 75% before changing to normal again. That’s why OP shows 7W drain, identical to idle drain on pure battery, instead of 0.5-ish W drain

I think I found the issue.

It looks like when it sets the mode to IDLE it sets current and voltage to 0. Then overwrites the voltage by 1 voltage step, which is not high enough, so as soon as there is a little load, the diode conducts and starts leaking. and since the current is 0 it never gets biased again, until we reach the min we switch to Normal mode, and we’re good.

Setting the min and max both to 60% fixes this issue (you can do it using the kernel driver). The reason that works is because as soon as it goes below 60% the voltage is set to max, so the diode is fine. and IDLE doesn’t leak.

I have confirmed setting 60% as both min and max fixes the issue. And currently am compiling the ec, to flash it with a fix for the scenario where min < max.

Opened a PR:

What happens if a 60W charger is used? Does it going to drag the voltage from max all the way to battery voltage so the battery can supply power during peak loads?

Yeah, works fine. Here I charged to 60% using my SteamDeck charger which is rated 45W. It parked the battery when it got to 60%, I ran a couple of compiles, it pulled from the battery when compiling and parked when finished: